From ea817f07f716a712f239152a0a10813c8aa4788e Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 16 Jul 2018 06:08:10 -0700 Subject: 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. --- share/txr/stdlib/op.tl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'share') 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))) -- cgit v1.2.3