diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2020-05-03 20:09:25 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2020-05-03 20:09:25 -0700 |
commit | d59fe717b97c4ff76ccf45e8c9652eb045f0c2ea (patch) | |
tree | af3402c988649e7183af88e357676686b759ff6a | |
parent | 5e4144f42a3e7f04f4eac88f8a1ea51c32841445 (diff) | |
download | txr-d59fe717b97c4ff76ccf45e8c9652eb045f0c2ea.tar.gz txr-d59fe717b97c4ff76ccf45e8c9652eb045f0c2ea.tar.bz2 txr-d59fe717b97c4ff76ccf45e8c9652eb045f0c2ea.zip |
symbol-function: bugfix: expand lambda expression.
* eval.c (lookup_fun): A lambda expression must be expanded
before being turned into a function.
* txr.1: Documented.
-rw-r--r-- | eval.c | 2 | ||||
-rw-r--r-- | txr.1 | 3 |
2 files changed, 3 insertions, 2 deletions
@@ -579,7 +579,7 @@ val lookup_fun(val env, val sym) } else if (car(sym) == macro_s) { return lookup_mac(nil, cadr(sym)); } else if (car(sym) == lambda_s) { - return cons(sym, func_interp(env, sym)); + return cons(sym, func_interp(env, expand(sym, nil))); } else { return nil; } @@ -16996,7 +16996,8 @@ If a .code lambda expression is passed to .codn symbol-function , -then the function implied by that expression is returned. +then the expression is macro-expanded and if that is successful, the function +implied by that expression is returned. It is unspecified whether this function is interpreted or compiled. The |