summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-04-04 07:58:11 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-04-04 07:58:11 -0700
commitbada505b8d75ea65976b919fc740f53ea338f8d9 (patch)
treec25847c2210138e434ddc1e52729098b4c2c8536 /txr.1
parentb7823a028556ed9daf442b035b32344a089d8410 (diff)
downloadtxr-bada505b8d75ea65976b919fc740f53ea338f8d9.tar.gz
txr-bada505b8d75ea65976b919fc740f53ea338f8d9.tar.bz2
txr-bada505b8d75ea65976b919fc740f53ea338f8d9.zip
doc: note about environment handling in compile.
* txr.1: Add notes about environment handling when an interpreted function is compiled, and how hlet/hlet* can be used to obtain sharing.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.112
1 files changed, 11 insertions, 1 deletions
diff --git a/txr.1 b/txr.1
index 1be7a991..df893a07 100644
--- a/txr.1
+++ b/txr.1
@@ -75474,12 +75474,22 @@ If the argument is a lambda expression, then that function is
compiled.
If the argument is a function object, and that object is an interpreted
-function, then its code is retrieved and compiled.
+function, then its code and lexical environment are retrieved and compiled.
In all cases, the return value of
.code compile
is the compiled function.
+Note: when an interpreted function object is compiled, the compiled environment
+does not share bindings with the original interpreted environment.
+Modifications to the bindings of either environment have no effect on the
+other. However, the objects referenced by the bindings are shared. Shared
+bindings may be arranged using the
+.code hlet
+or
+.code hlet*
+macros.
+
.coNP Functions @ compile-file and @ compile-update-file
.synb
.mets (compile-file < input-path <> [ output-path ])