summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-04-13 06:47:52 -0700
committerKaz Kylheku <kaz@kylheku.com>2018-04-13 06:47:52 -0700
commitb1718cf88484b311911361bbad2f22c24d026d02 (patch)
treebd945eda308ffdec08da1ff53278644468935c73 /share
parent65312028c807acb987f78c73474ee790e6cba24c (diff)
downloadtxr-b1718cf88484b311911361bbad2f22c24d026d02.tar.gz
txr-b1718cf88484b311911361bbad2f22c24d026d02.tar.bz2
txr-b1718cf88484b311911361bbad2f22c24d026d02.zip
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 ...) ...).
Diffstat (limited to 'share')
-rw-r--r--share/txr/stdlib/compiler.tl2
1 files changed, 2 insertions, 0 deletions
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)