diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2012-08-30 02:29:09 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2012-08-30 02:29:09 -0700 |
commit | 793a7f441019b6788c260621f2e6e7a42899da21 (patch) | |
tree | aa81f81ebce406a68a4a0273653e020d9a3e33a5 | |
parent | 05ebefa3edfb2cf6dfd478c96630f49ced30845c (diff) | |
download | txr-793a7f441019b6788c260621f2e6e7a42899da21.tar.gz txr-793a7f441019b6788c260621f2e6e7a42899da21.tar.bz2 txr-793a7f441019b6788c260621f2e6e7a42899da21.zip |
* eval.c (eval_intrinsic): Bugfix: take the expanded form instead
of throwing it away.
(expand): Recurse into expand_place for (set ...) forms.
* txr.1: Documented eval.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | eval.c | 4 | ||||
-rw-r--r-- | txr.1 | 15 |
3 files changed, 25 insertions, 2 deletions
@@ -1,5 +1,13 @@ 2012-08-30 Kaz Kylheku <kaz@kylheku.com> + * eval.c (eval_intrinsic): Bugfix: take the expanded form instead + of throwing it away. + (expand): Recurse into expand_place for (set ...) forms. + + * txr.1: Documented eval. + +2012-08-30 Kaz Kylheku <kaz@kylheku.com> + * txr.1: Documented all functions related to hashing. 2012-08-29 Kaz Kylheku <kaz@kylheku.com> @@ -393,7 +393,7 @@ val interp_fun(val env, val fun, val args) static val eval_intrinsic(val form, val env) { uses_or2; - expand(form); + form = expand(form); return eval(form, or2(env, make_env(nil, nil, env)), form); } @@ -1643,7 +1643,7 @@ val expand(val form) if (body == body_ex) return form; return rlcp(cons(sym, cons(name, cons(args, body_ex))), form); - } else if (sym == inc_s || sym == dec_s) { + } else if (sym == set_s || sym == inc_s || sym == dec_s) { val place = second(form); val inc = third(form); val place_ex = expand_place(place); @@ -7631,6 +7631,21 @@ each list correspond to the pairs in the hash table. .SS Function eval +.TP +Syntax: + + (eval <form> <env>) + +.TP +Description: + +The eval function treats the <form> object as a Lisp expression, which is +evaluated. The side effects implied by the form are performed, and the value +which it produces is returned. The <env> object specifies an environment for +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 top-level environment. + .SS Function chain .SS Functions andf and orf |