From 52e1a059ea7feae38efb71330c83a671560e29fa Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 7 Jul 2017 07:00:14 -0700 Subject: 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. --- eval.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'eval.c') diff --git a/eval.c b/eval.c index f8186977..e2759186 100644 --- a/eval.c +++ b/eval.c @@ -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), -- cgit v1.2.3