aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md4
-rw-r--r--who.tl16
2 files changed, 13 insertions, 7 deletions
diff --git a/README.md b/README.md
index 762c0e5..030096d 100644
--- a/README.md
+++ b/README.md
@@ -345,6 +345,10 @@ entire body. However, if a pattern is specified, the body material
is destructurd, which effectively allows `deftag` tags to
have parameters, as in the `:atag` example above.
+### Returns:
+
+The `deftag` macro returns the `<keyword>` parameter.
+
## Dependencies
TL-WHO has no external dependencies other than TXR itself.
diff --git a/who.tl b/who.tl
index 12ce78d..794645c 100644
--- a/who.tl
+++ b/who.tl
@@ -341,10 +341,12 @@
(key-params (if (consp attr-param-list)
(butlast attr-param-list 0))))
(with-gensyms (body-arg)
- ^(set [*tag-macro* ,keyword]
- (lambda (:key ,body-arg -- ,*attr-param-list)
- (mac-env-param-bind *cur-form* *cur-env* ,body-pattern ,body-arg
- ,*(if (and rest-param key-params)
- ^((set ,rest-param
- (scrub-kw-args ',key-params ,rest-param))))
- ,*body))))))
+ ^(progn
+ (set [*tag-macro* ,keyword]
+ (lambda (:key ,body-arg -- ,*attr-param-list)
+ (mac-env-param-bind *cur-form* *cur-env* ,body-pattern ,body-arg
+ ,*(if (and rest-param key-params)
+ ^((set ,rest-param
+ (scrub-kw-args ',key-params ,rest-param))))
+ ,*body)))
+ ,keyword))))