diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-08-07 23:28:23 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-08-07 23:28:23 -0700 |
commit | e99c890b7bdd54dbbb83d25c3e9adb2f95c960c7 (patch) | |
tree | 6e650b842aca39a0c5285a709b031e61a557b3d1 | |
parent | b82650d684d3aa9ace96b90d832f42d269723a36 (diff) | |
download | txr-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.tl | 2 |
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))))) |