summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-09-11 18:42:00 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-09-11 18:42:00 -0700
commit7b28c795b04bef5328b64fa50498d13d8a642e3b (patch)
tree3bfb45cc0220ef144a858fc24ce7814b251887fc /share
parent41491701550523a649c256a10a4748030423f427 (diff)
downloadtxr-7b28c795b04bef5328b64fa50498d13d8a642e3b.tar.gz
txr-7b28c795b04bef5328b64fa50498d13d8a642e3b.tar.bz2
txr-7b28c795b04bef5328b64fa50498d13d8a642e3b.zip
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.
Diffstat (limited to 'share')
-rw-r--r--share/txr/stdlib/place.tl6
1 files changed, 6 insertions, 0 deletions
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))