diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2022-10-13 20:23:35 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-10-13 20:23:35 -0700 |
commit | 378546295be6b3a72ee3792d9175501bc77c016d (patch) | |
tree | bafa7f54ab53ae1edb96cdce20165f4bdf18d88b /stdlib | |
parent | 8b00ff477f752ea4e11290be398b5a3cf98cf7ab (diff) | |
download | txr-378546295be6b3a72ee3792d9175501bc77c016d.tar.gz txr-378546295be6b3a72ee3792d9175501bc77c016d.tar.bz2 txr-378546295be6b3a72ee3792d9175501bc77c016d.zip |
New function: macroexpand-struct-clause.
* stdlib/struct.tl (macroexpand-struct-clause): New function.
* autoload.c (struct_set_entries): Autoload struct module
on macroexpand-struct-clause.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
Diffstat (limited to 'stdlib')
-rw-r--r-- | stdlib/doc-syms.tl | 1 | ||||
-rw-r--r-- | stdlib/struct.tl | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/stdlib/doc-syms.tl b/stdlib/doc-syms.tl index 2b0edcaf..08dcc8e2 100644 --- a/stdlib/doc-syms.tl +++ b/stdlib/doc-syms.tl @@ -1190,6 +1190,7 @@ ("macroexpand-match" "N-02CCCB67") ("macroexpand-params" "N-037EB49A") ("macroexpand-place" "N-00684FF9") + ("macroexpand-struct-clause" "N-01046265") ("macrolet" "N-00AC12C0") ("madv-dontneed" "N-027D1E84") ("madv-normal" "N-027D1E84") diff --git a/stdlib/struct.tl b/stdlib/struct.tl index 10b07710..855ac6e1 100644 --- a/stdlib/struct.tl +++ b/stdlib/struct.tl @@ -415,6 +415,11 @@ (mac-param-bind ,form ,params (cdr ,slot) ,*body))) ,keyword))) +(defun macroexpand-struct-clause (clause : form) + (iflet ((xfun (and (consp clause) [*struct-clause-expander* (car clause)]))) + [xfun clause form] + (cons clause nil))) + (compile-only (load-for (struct sys:param-parser-base "param"))) |