diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2018-05-01 21:00:18 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2018-05-01 21:00:18 -0700 |
commit | af08d50472cedf839e3260e2d6e745fc3836d2fc (patch) | |
tree | 35288166ce17f2f06c8446ef2e594ab6c492d8b4 /ffi.c | |
parent | 771499a17a7d6dcdc962e74201d7ee0ffa8d9f87 (diff) | |
download | txr-af08d50472cedf839e3260e2d6e745fc3836d2fc.tar.gz txr-af08d50472cedf839e3260e2d6e745fc3836d2fc.tar.bz2 txr-af08d50472cedf839e3260e2d6e745fc3836d2fc.zip |
compiler: correct semantics of special var args.
The same, correct semantics for special variables in function
arguments get implemented in the compiler.
* share/txr/stdlib/compiler.tl (compiler comp-lambda): We
stick with the strategy that each parameter which is a
special variable is aliased by an anonymous lexical
variable. The difference is that we bind the underlying
special variable from the hidden lexical's value as early as
possible. The overall processing is rearranged. On entry
into the function, if any of the required arguments are
specials, their values are immediately bound to the special
variables in a new environment. Then the optional arguments
are processed, and they bind specials in the dynamic
environment also. Previously, the specials were bound in
one fell swoop after processing the optionals, leading to the
same incorrect semantics that the interpreter code had.
Diffstat (limited to 'ffi.c')
0 files changed, 0 insertions, 0 deletions