diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-07-07 07:00:14 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-07-07 07:00:14 -0700 |
commit | 52e1a059ea7feae38efb71330c83a671560e29fa (patch) | |
tree | 0c1f57afcdfb43a21870fad39690ddeb7b71a96b /eval.c | |
parent | 10d16b5da0b45265d669f061db6f4457c4661811 (diff) | |
download | txr-52e1a059ea7feae38efb71330c83a671560e29fa.tar.gz txr-52e1a059ea7feae38efb71330c83a671560e29fa.tar.bz2 txr-52e1a059ea7feae38efb71330c83a671560e29fa.zip |
Lisp: lambda expressions are function names now.
* eval.c (lookup_fun): With this two-liner change, the
forms ((lambda (x) x) 42) and (fun (lambda ()))
just work. This is not just compatibility with other
dialects; it is necessary for consistency with func-get-name,
which already returns lambda expressions, effectively
asserting that they are function names.
* txr.1: Fix documentation for fun operator. The
Dialect Note saying that a lambda expression is not a
function name in TXR Lisp is removed. Document that
function names may be any of those produced by
func-get-name. This has already been true for macros
and methods, just not for lambda expressions.
Under fun-get-name, document that lambda expressions
are produced for interpreted functions not found in
any binding by the previous searches.
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -490,6 +490,8 @@ val lookup_fun(val env, val sym) cons(sym, static_slot(type, slot))); } 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 or2(gethash(top_fb, sym), |