From b1718cf88484b311911361bbad2f22c24d026d02 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 13 Apr 2018 06:47:52 -0700 Subject: compiler: bugfix: handle lambda call form. Looks like the compiler neglects to handle the syntax ((lambda (params ...) body ...) args ...). * share/txr/stdlib/compiler.tl (compiler compile): Check for a lambda expression in the car position of a form; if it's present then ((lambda ...) ...) -> (call (lambda ...) ...). --- share/txr/stdlib/compiler.tl | 2 ++ 1 file changed, 2 insertions(+) (limited to 'share') diff --git a/share/txr/stdlib/compiler.tl b/share/txr/stdlib/compiler.tl index a10f4f14..d58ed2c3 100644 --- a/share/txr/stdlib/compiler.tl +++ b/share/txr/stdlib/compiler.tl @@ -244,6 +244,8 @@ (t (compile-error form "unrecognized special operator ~s" sym)))) ((bindable sym) me.(comp-fun-form oreg env form)) + ((and (consp sym) + (eq (car sym) 'lambda)) me.(compile oreg env ^(call ,*form))) (t (compile-error form "invalid operator"))))))) (defmeth compiler comp-atom (me oreg form) -- cgit v1.2.3