summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-12-27 21:02:11 -0800
committerKaz Kylheku <kaz@kylheku.com>2021-12-27 21:02:11 -0800
commitf92695927b6180fb259bf092179d5896098256eb (patch)
treed1a0934d0fdc07166311a7b1c422f3216c8b2b7e
parent938b1031caac9d25b86303d3787295a3b63c80cc (diff)
downloadtxr-f92695927b6180fb259bf092179d5896098256eb.tar.gz
txr-f92695927b6180fb259bf092179d5896098256eb.tar.bz2
txr-f92695927b6180fb259bf092179d5896098256eb.zip
doc: document *struct-clause-expander*.
* txr.1: New section about special variable *struct-clause-expander*. * stdlib/doc-syms.tl: Updated.
-rw-r--r--stdlib/doc-syms.tl1
-rw-r--r--txr.130
2 files changed, 31 insertions, 0 deletions
diff --git a/stdlib/doc-syms.tl b/stdlib/doc-syms.tl
index bb51d785..fff64b8a 100644
--- a/stdlib/doc-syms.tl
+++ b/stdlib/doc-syms.tl
@@ -54,6 +54,7 @@
("*stdlog*" "N-00854995")
("*stdnull*" "N-006566FB")
("*stdout*" "N-006566FB")
+ ("*struct-clause-expander*" "N-0141A208")
("*trace-output*" "N-0067A6AC")
("*tree-fun-whitelist*" "N-025AB9C9")
("*unhandled-hook*" "N-02B4A4FB")
diff --git a/txr.1 b/txr.1
index 04e9598c..fe24fd6f 100644
--- a/txr.1
+++ b/txr.1
@@ -31222,6 +31222,36 @@ or a subtype thereof.
fa.(write 4) -> ;; error: fa has no such method
.brev
+.coNP Special variable @ *struct-clause-expander*
+.desc
+The
+.code *struct-clause-expander*
+special variable holds the hash table of associations between
+keyword symbols and struct clause expander functions, defined by
+.codn define-struct-clause .
+
+If the expression
+.code "[*struct-clause-expander* :sym]"
+yields a function, then symbol
+.code :sym
+has a binding as a struct clause macro. If that
+expression yields
+.codn nil ,
+then there is no such binding.
+
+The macro expanders in
+.code *struct-clause-expander*
+are two-parameter functions. The first parameter accepts the
+clause to to be expanded. The second parameter accepts the
+.code defstruct
+form in which that clause is found; this is useful for error
+reporting.
+
+An expander function returns a list of clauses, which may be any, possibly
+empty mixture of primary clauses accepted by
+.code defstruct
+and clause macros.
+
.SS* Special Structure Functions
Special structure functions are user-defined methods or structure functions