summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-03-08 08:25:42 -0800
committerKaz Kylheku <kaz@kylheku.com>2019-03-08 08:25:42 -0800
commitfe533f82ee26d0bf98468f25b263e8f8461f309e (patch)
tree2a571b675dd49453aac1cc0c57c6ffa274c6ecee /txr.1
parentc0d469720866b2b6139fa9af862f0c7316117e37 (diff)
downloadtxr-fe533f82ee26d0bf98468f25b263e8f8461f309e.tar.gz
txr-fe533f82ee26d0bf98468f25b263e8f8461f309e.tar.bz2
txr-fe533f82ee26d0bf98468f25b263e8f8461f309e.zip
defset: support improper list places.
* share/txr/stdlib/defset.tl (defset-expander): Check for restpar being an atom and handle differently. We still don't handle the case where (b . c) is matched against a rest parameter; in this case the mapcar will process an improper list. I.e. the improper form must have an atom which matches the position of the rest parameter. * txr.1: Updated.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.117
1 files changed, 15 insertions, 2 deletions
diff --git a/txr.1 b/txr.1
index 541bef80..3115d465 100644
--- a/txr.1
+++ b/txr.1
@@ -34623,8 +34623,21 @@ the two trailing parameters corresponding to the rest parameter
Syntactic places defined by
.code defset
-may not use improper syntax such as
-.codn "(set (g 1 2 . 3) v)" .
+that have a rest parameter may be invoked with improper syntax such as
+.codn "(set (g x y . z) v)" .
+In this situation, that rest parameter will be bound to the name of
+a temporary variable which holds the value of
+.code z
+rather than to a list of temporary variable names holding the values
+of trailing expressions.
+The
+.code get-form
+and
+.code set-form
+must be prepared for this situation. In particular, the rest parameter's value
+is an atom, then it cannot be spliced in the backquote syntax, except at the
+last position of a list.
+
Although syntactic places defined by
.code defset
perform macro-parameter-like destructuring of the place form, binding