From 7b28c795b04bef5328b64fa50498d13d8a642e3b Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 11 Sep 2016 18:42:00 -0700 Subject: New alet macro. * lisplib.c (place_set_entries): Add alet symbol to autoload list for place.tl. * share/txr/stdlib/place.tl (alet): New macro. * txr.1: Documented alet. --- share/txr/stdlib/place.tl | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'share') diff --git a/share/txr/stdlib/place.tl b/share/txr/stdlib/place.tl index 74b5b01d..4d5e63dd 100644 --- a/share/txr/stdlib/place.tl +++ b/share/txr/stdlib/place.tl @@ -133,6 +133,12 @@ (defmacro slet (bindings :env e . body) (sys:r-s-let-expander bindings body e [orf constantp bindable])) +(defmacro alet (bindings :env e . body) + (let ((exp-bindings (mapcar (aret ^(,@1 ,(macroexpand @2 e))) bindings))) + ^(,(if [all exp-bindings [orf constantp bindable] second] + 'symacrolet 'let) + ,exp-bindings ,*body))) + (defmacro with-gensyms (syms . body) ^(let ,(zip syms (repeat '((gensym)))) ,*body)) -- cgit v1.2.3