diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2018-07-16 06:08:10 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2018-07-16 06:08:10 -0700 |
commit | ea817f07f716a712f239152a0a10813c8aa4788e (patch) | |
tree | 3fcd22c37a1cc52cd3fed7e7261384cb2aaa5ae4 /share | |
parent | f71aad515d95107da81a3f70d080e75675ce87e2 (diff) | |
download | txr-ea817f07f716a712f239152a0a10813c8aa4788e.tar.gz txr-ea817f07f716a712f239152a0a10813c8aa4788e.tar.bz2 txr-ea817f07f716a712f239152a0a10813c8aa4788e.zip |
op: convert to Lisp trivial macros related to op.
The op macro is no longer written in C, but the trivial macros
ap, ip, ado, ido, ret and aret are still C. It's silly to
have macros written in C, baked into the TXR executable, which
just produce syntax for a complicated macro written in Lisp
that must be autoloaded when that code is used.
* eval.c (ap_s, apf_s, ipf_s, ret_s, aret_s): Variables removed.
(me_ap, me_ip, me_ado, me_ido, me_ret_aret): Functions removed.
(eval_init): Do not initialize removed variables. Remove
registration for macros ap, ip, ado, ido, ret and aret.
Intern the apf and ipf symbols in the same expression
which registers these functions.
* lisplib.c (op_set_entries): Add autoload entries for ap,
ip, ado, ido, ret and aret.
* share/txr/stdlib/op.tl (ap, ip, ado, ido, ret, aret):
New macros.
* protsym.c: Regenerated.
Diffstat (limited to 'share')
-rw-r--r-- | share/txr/stdlib/op.tl | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/share/txr/stdlib/op.tl b/share/txr/stdlib/op.tl index b93b4e17..2457a096 100644 --- a/share/txr/stdlib/op.tl +++ b/share/txr/stdlib/op.tl @@ -105,3 +105,21 @@ (defmacro lop (:form f :env e . args) (sys:op-expand f e args)) + +(defmacro ap (. args) + ^(apf (op ,*args))) + +(defmacro ip (. args) + ^(ipf (op ,*args))) + +(defmacro ado (. args) + ^(apf (do ,*args))) + +(defmacro ido (. args) + ^(ipf (do ,*args))) + +(defmacro ret (. args) + ^(op identity (progn @rest ,*args))) + +(defmacro aret (. args) + ^(ap identity (progn @rest ,*args))) |