summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-03-02 22:04:16 -0800
committerKaz Kylheku <kaz@kylheku.com>2014-03-02 22:04:16 -0800
commitcb4b820893b2cc48a70f2a2f0d70863fb191d7aa (patch)
treef6a6b004d2dfe0daec6b0a726c53817780601949 /txr.1
parente23eefb30af6f88ca18887131c547a545c9edbef (diff)
downloadtxr-cb4b820893b2cc48a70f2a2f0d70863fb191d7aa.tar.gz
txr-cb4b820893b2cc48a70f2a2f0d70863fb191d7aa.tar.bz2
txr-cb4b820893b2cc48a70f2a2f0d70863fb191d7aa.zip
* eval.c (make_env_intrinsic): New static function.
(eval_init): Register new intrinsics make-env, env-fbind and env-vbind. * txr.1: Documented.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.143
1 files changed, 43 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index 853a6988..173d2d41 100644
--- a/txr.1
+++ b/txr.1
@@ -5802,6 +5802,49 @@ resolving the function and variable references encountered in the expression.
The object nil can be specified as an environment, in which case the evaluation
takes place in the global environment.
+See also: the make-env function.
+
+.SS Function make-env
+
+.TP
+Syntax:
+
+ (make-env [<variable-bindings> [<function-bindings> [<next-env>]]])
+
+.TP
+Description:
+
+The make-env function creates an environment object suitable as the <env> parameter.
+
+The <variable-bindings> and <function-bindings> parameters, if specified,
+should be association lists, mapping symbols to objects. The objects in
+<function-bindings> should be functions, or objects callable as functions.
+
+The <next-env> argument, if specified, should be an environment.
+
+Note: bindings can also be added to an environment usign the env-vbind
+and env-fbind functions.
+
+.SS Functions env-vbind and env-fbind
+
+.TP
+Syntax:
+
+ (env-vbind <env> <symbol> <value>)
+ (env-fbind <env> <symbol> <value>)
+
+.TP
+Description:
+
+These functions bind a symbol to a value in either the function or variable space
+of environment <env>.
+
+Values established in the function space should be functions or objects that
+can be used as functions such as lists, strings, arrays or hashes.
+
+If <symbol> already exists in the environment, in the given space, then its
+value is updated with <value>.
+
.SH MUTATION
.SS Operators inc, dec, set, push, pop, flip and del