summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-03-08 08:17:28 -0800
committerKaz Kylheku <kaz@kylheku.com>2019-03-08 08:17:28 -0800
commitc0d469720866b2b6139fa9af862f0c7316117e37 (patch)
tree7c70ab99d2ad433a74b60dcdaf6d0eabca4e45d7 /txr.1
parent6438a2e747c834da59fbaf1704a72b184d40c5d8 (diff)
downloadtxr-c0d469720866b2b6139fa9af862f0c7316117e37.tar.gz
txr-c0d469720866b2b6139fa9af862f0c7316117e37.tar.bz2
txr-c0d469720866b2b6139fa9af862f0c7316117e37.zip
defset: support parameter macros.
* defset.tl (defset-expander): Add logic to expand parameter list to determine additional paramters that may come out of the expansion, as well as additional symbols that may be visible as a result as a result of processing in the expanded body. These symbols are included in the same way as original the original parameters. * txr.1: Documented defset's support for parameter list macros.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.133
1 files changed, 33 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index 173c7e38..541bef80 100644
--- a/txr.1
+++ b/txr.1
@@ -34625,6 +34625,39 @@ Syntactic places defined by
.code defset
may not use improper syntax such as
.codn "(set (g 1 2 . 3) v)" .
+Although syntactic places defined by
+.code defset
+perform macro-parameter-like destructuring of the place form, binding
+unevaluated argument expressions to the parameter symbols,
+nested macro parameter lists are not supported:
+.meta params
+specifies a function parameter list.
+
+The parameter list may use parameter macros, keeping in mind that
+the parameter expansion is applied at the time the
+.code defset
+form is processed, specifying an expanded parameter list which
+receives unevaluated expressions. The
+.meta get-form
+and
+.meta set-form
+may refer to all symbols produced by parameter list expansion, other
+than generated symbols. For instance, if a parameter list macro
+.code :addx
+exists which adds the parameter symbol
+.code x
+to the parameter list, and this
+.code :addx
+is invoked in the
+.meta params
+list of a
+.codn defset ,
+then
+.code x
+will be visible to the
+.meta get-form
+and
+.metn set-form .
The short, two-argument form of
.code defset