summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-04-07 23:25:13 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-04-07 23:25:13 -0700
commit1cafc3e511b19f22ad6eb8c49c3f4cd7f87ece6a (patch)
tree662c337ba2bcfa647e95cb50f75623d5d2dea838 /txr.1
parent8fbc54a73f476c46b8d0d08c6cc700a7ca6a39c1 (diff)
downloadtxr-1cafc3e511b19f22ad6eb8c49c3f4cd7f87ece6a.tar.gz
txr-1cafc3e511b19f22ad6eb8c49c3f4cd7f87ece6a.tar.bz2
txr-1cafc3e511b19f22ad6eb8c49c3f4cd7f87ece6a.zip
Allow symbol macro in function call dot position.
* eval.c (expand_forms): If the forms list is an atom, then don't just return it. Try to expand it as a macro. If the macro produces a compound form, diagnose with an exception, otherwise return the expansion. * txr.1: Document the treatment of symbol macros in function call dot position.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.114
1 files changed, 14 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index b030b9b7..62ffe92c 100644
--- a/txr.1
+++ b/txr.1
@@ -10079,6 +10079,20 @@ Examples:
(call (op list 1 . @1) 2) ;; yields 2
.cble
+A special consideration is given to symbol macros which occur in the
+dot position. If a symbol macro occurs in this position, then it must not
+expand to a compound form, otherwise a macro-expansion-time error results.
+If it expands to an atom, then it is substituted by that atom, and
+the semantics of the function call proceeds as described above.
+
+.cblk
+ (symacrolet ((x (list 1 2)))
+ (list 1 . x)) ;; error: x expands to form (list 1 2)
+
+ (symacrolet ((x 2))
+ (list 1 . x)) ;; yields (1 . 2)
+.cble
+
Dialect Note:
In some other Lisp dialects like ANSI Common Lisp, the improper list syntax may