summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-08-07 23:28:23 -0700
committerKaz Kylheku <kaz@kylheku.com>2019-08-07 23:28:23 -0700
commitb0baa05b61bbec3e0cb762ec51b1b16be79595f9 (patch)
tree6e650b842aca39a0c5285a709b031e61a557b3d1
parente98581cc2bb7c9f50194f4231d9ed85bd25e93c3 (diff)
downloadtxr-b0baa05b61bbec3e0cb762ec51b1b16be79595f9.tar.gz
txr-b0baa05b61bbec3e0cb762ec51b1b16be79595f9.tar.bz2
txr-b0baa05b61bbec3e0cb762ec51b1b16be79595f9.zip
compiler: bugfix: scoping issue in inline lambda.
* share/txr/stdlib/compiler.tl (lambda-apply-transform): The gensym for binding the trailing argument expression must be bound before any of the parameters, otherwise the expression is exposed to the scope of the parameters that have been emitted so far. We use add* to put it at the front.
-rw-r--r--share/txr/stdlib/compiler.tl2
1 files changed, 1 insertions, 1 deletions
diff --git a/share/txr/stdlib/compiler.tl b/share/txr/stdlib/compiler.tl
index 4bf56c31..485d83be 100644
--- a/share/txr/stdlib/compiler.tl
+++ b/share/txr/stdlib/compiler.tl
@@ -1522,7 +1522,7 @@
((and fix-arg-exprs apply-list-expr)
(lambda-too-many-args lm-expr))
(apply-list-expr
- (add ^(,al-val ,apply-list-expr))
+ (add* ^(,al-val ,apply-list-expr))
(when pars.req
(add ^(,ign-sym (if (< (len ,al-val) ,(len pars.req))
(lambda-short-apply-list)))))