diff options
-rw-r--r-- | README.md | 4 | ||||
-rw-r--r-- | who.tl | 16 |
2 files changed, 13 insertions, 7 deletions
@@ -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. @@ -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)))) |