APPROVE COMMIT
NOTE: This patch has been committed
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1509285584 0
# Sun Oct 29 13:59:44 2017 +0000
# Node ID efa8f1377817cf7f529bbd39b58857c7675c59ad
# Parent 450ec5be18d1431b8a6f8377d836a2bc86f59f59
#'cl-macro-expand-all; delay symbol macro shadowing until all args processed, let
lisp/ChangeLog addition:
2017-10-29 Aidan Kehoe <kehoea(a)parhasard.net>
* cl-extra.el (cl-macroexpand-all):
When processing a let binding, and an existing symbol macro has
the same symbol name as the let binding, delay shadowing until all
bindings are processed.
tests/ChangeLog addition:
2017-10-29 Aidan Kehoe <kehoea(a)parhasard.net>
* automated/lisp-tests.el:
Test the SHADOW argument to symbol-macrolet.
diff -r 450ec5be18d1 -r efa8f1377817 lisp/ChangeLog
--- a/lisp/ChangeLog Sun Oct 29 13:48:11 2017 +0000
+++ b/lisp/ChangeLog Sun Oct 29 13:59:44 2017 +0000
@@ -1,3 +1,10 @@
+2017-10-29 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * cl-extra.el (cl-macroexpand-all):
+ When processing a let binding, and an existing symbol macro has
+ the same symbol name as the let binding, delay shadowing until all
+ bindings are processed.
+
2017-10-12 Aidan Kehoe <kehoea(a)parhasard.net>
* frame.el (frame-utmost-window-2): Made into a label.
diff -r 450ec5be18d1 -r efa8f1377817 lisp/cl-extra.el
--- a/lisp/cl-extra.el Sun Oct 29 13:48:11 2017 +0000
+++ b/lisp/cl-extra.el Sun Oct 29 13:59:44 2017 +0000
@@ -523,7 +523,7 @@
(push `(,eq-hash . nil) env)
;; `let'; delay until all bindings
;; processed.
- (push `(,eq-hash . nil) env))
+ (push `(,eq-hash . nil) shadows))
;; Don't shadow it.
(setq symbol (car acons))
(unless (symbolp symbol) (setq letf t)))
diff -r 450ec5be18d1 -r efa8f1377817 tests/ChangeLog
--- a/tests/ChangeLog Sun Oct 29 13:48:11 2017 +0000
+++ b/tests/ChangeLog Sun Oct 29 13:59:44 2017 +0000
@@ -1,3 +1,8 @@
+2017-10-29 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * automated/lisp-tests.el:
+ Test the SHADOW argument to symbol-macrolet.
+
2017-10-29 Aidan Kehoe <kehoea(a)parhasard.net>
* automated/mule-tests.el:
diff -r 450ec5be18d1 -r efa8f1377817 tests/automated/lisp-tests.el
--- a/tests/automated/lisp-tests.el Sun Oct 29 13:48:11 2017 +0000
+++ b/tests/automated/lisp-tests.el Sun Oct 29 13:59:44 2017 +0000
@@ -3034,6 +3034,21 @@
(Assert (equal '([symbol expansion] [copy expansion] [third expansion])
(test-symbol-macrolet))))
+;; And test it with the SHADOW argument.
+
+(Assert (eql (let ((hello 20) (everyone 5))
+ (symbol-macrolet ((hello everyone))
+ (let ((hello (+ hello 5)))
+ hello)))
+ 10))
+
+(Assert (eql (let ((hello 20) (everyone 5))
+ (symbol-macrolet ((hello everyone t))
+ (let ((hello (+ hello 5))
+ (there (+ hello 10)))
+ (+ hello there))))
+ 25))
+
;; Basic tests of #'apply-partially.
(let* ((four 4)
(times-four (apply-partially '* four))
--
‘As I sat looking up at the Guinness ad, I could never figure out /
How your man stayed up on the surfboard after forty pints of stout’
(C. Moore)