diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2022-10-13 07:58:47 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-10-13 07:58:47 -0700 |
commit | 8b00ff477f752ea4e11290be398b5a3cf98cf7ab (patch) | |
tree | 6ddae1f89b191e0eb6733cef0ba53ab53971faec /stdlib | |
parent | 8629f3e1eb6860d72861800ed5004cf0ae5dd2b3 (diff) | |
download | txr-8b00ff477f752ea4e11290be398b5a3cf98cf7ab.tar.gz txr-8b00ff477f752ea4e11290be398b5a3cf98cf7ab.tar.bz2 txr-8b00ff477f752ea4e11290be398b5a3cf98cf7ab.zip |
New function: macroexpand-match.
* stdlib/match.tl (macroexpand-match): New function.
* autoload.c (match_set_entries): Autoload match
module on macroexpand-match.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
Diffstat (limited to 'stdlib')
-rw-r--r-- | stdlib/doc-syms.tl | 1 | ||||
-rw-r--r-- | stdlib/match.tl | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/stdlib/doc-syms.tl b/stdlib/doc-syms.tl index e75ad2c7..2b0edcaf 100644 --- a/stdlib/doc-syms.tl +++ b/stdlib/doc-syms.tl @@ -1187,6 +1187,7 @@ ("macroexpand-1-lisp1" "N-01E62179") ("macroexpand-1-place" "N-00684FF9") ("macroexpand-lisp1" "N-01E62179") + ("macroexpand-match" "N-02CCCB67") ("macroexpand-params" "N-037EB49A") ("macroexpand-place" "N-00684FF9") ("macrolet" "N-00AC12C0") diff --git a/stdlib/match.tl b/stdlib/match.tl index 55d50417..ff3134fd 100644 --- a/stdlib/match.tl +++ b/stdlib/match.tl @@ -833,6 +833,11 @@ ,args ,*body))) ',name))) +(defun macroexpand-match (pattern : env) + (iflet ((xfun (and (consp pattern) [*match-macro* (car pattern)]))) + [xfun pattern env] + pattern)) + (defun check (f op pat) (if (or (not (listp pat)) (meq (car pat) 'sys:expr 'sys:var 'sys:quasi)) |