diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2018-04-13 06:47:52 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2018-04-13 06:47:52 -0700 |
commit | fca03e9e8e9cac6a2929061a1fd5025045585988 (patch) | |
tree | bd945eda308ffdec08da1ff53278644468935c73 | |
parent | 9a9d0a908dd139aabafb3a2ded0aaadc682fb96b (diff) | |
download | txr-fca03e9e8e9cac6a2929061a1fd5025045585988.tar.gz txr-fca03e9e8e9cac6a2929061a1fd5025045585988.tar.bz2 txr-fca03e9e8e9cac6a2929061a1fd5025045585988.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 ...) ...).
-rw-r--r-- | share/txr/stdlib/compiler.tl | 2 |
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) |