diff options
-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 |