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
commite99c890b7bdd54dbbb83d25c3e9adb2f95c960c7 (patch)
tree6e650b842aca39a0c5285a709b031e61a557b3d1
parentb82650d684d3aa9ace96b90d832f42d269723a36 (diff)
downloadtxr-e99c890b7bdd54dbbb83d25c3e9adb2f95c960c7.tar.gz
txr-e99c890b7bdd54dbbb83d25c3e9adb2f95c960c7.tar.bz2
txr-e99c890b7bdd54dbbb83d25c3e9adb2f95c960c7.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)))))