diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-04-04 07:58:11 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-04-04 07:58:11 -0700 |
commit | bada505b8d75ea65976b919fc740f53ea338f8d9 (patch) | |
tree | c25847c2210138e434ddc1e52729098b4c2c8536 /txr.1 | |
parent | b7823a028556ed9daf442b035b32344a089d8410 (diff) | |
download | txr-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.1 | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -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 ]) |