summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-05-17 07:31:44 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-05-17 07:31:44 -0700
commit397dbe73e1f071af86ca278ea2bbc002a1ce45d6 (patch)
treeb5304cefc562b6085986a6528088fc2d1fa39f6a
parent50812f5ef2bcf6e8118a835868486f9f3dcf8cf9 (diff)
downloadtxr-397dbe73e1f071af86ca278ea2bbc002a1ce45d6.tar.gz
txr-397dbe73e1f071af86ca278ea2bbc002a1ce45d6.tar.bz2
txr-397dbe73e1f071af86ca278ea2bbc002a1ce45d6.zip
doc: macrolet doesn't contain top-level forms.
* txr.1: For eval and for compilation, document that symacrolet and macrolet do not enclose multiple top-level forms.
-rw-r--r--txr.128
1 files changed, 28 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index ec2b36be..24122eb6 100644
--- a/txr.1
+++ b/txr.1
@@ -17869,6 +17869,25 @@ forms the reference model for how the
.code load
function processes top-level forms.
+Note that, according to these rules, the constituent body forms of a
+.code macrolet
+or
+.code symacrolet
+top-level form are not individual top-level forms, even if the
+expansion of the construct combines the expanded versions of those
+forms with
+.codn progn .
+
+The form
+.code "(macrolet () (defmacro foo ()) (foo))"
+will therefore not work correctly. However, the specific problem in
+this situation can be be resolved by rewriting
+.code foo
+as a
+.code macrolet
+macro:
+.codn "(macrolet ((foo ())) (foo))" .
+
See also: the
.code make-env
function.
@@ -76778,6 +76797,15 @@ This means that it is not a form based on any of the operators
or
.codn eval-only .
+Note that the constituent body forms of a
+.code macrolet
+or
+.code symacrolet
+top-level form are not individual top-level forms, even if the
+expansion of the construct combines the expanded versions of those
+forms with
+.codn progn .
+
.SS* File Compilation Model
The file compiler reads each successive forms from a file, performs a partial