[bitc-dev] Re-examining pair consing
Jonathan S. Shapiro
shap at eros-os.com
Tue Jul 8 09:56:52 CDT 2008
There is a variant on pair-consing that preserves the varargs capability
without breaking BY-REF arguments. As currently, we check arity at apply
time, but we interpret
(lambda (x y ...) ...)
to mean that the procedure requires exactly two formal parameters, but
that applications may provide an arbitrary number of actual parameters.
The apply-time behavior of
(f x y ... z)
is to pair-cons the *trailing* arguments.
There is a potential problem here that
(f 1 2 3)
cannot be distinguished (in the receiver) by
(f 1 (pair 2 3))
If this is a problem, we can define the "..." behavior so as to always
append a trailing instance of unit so that the parameter in varargs
position is always a pair.
shap
More information about the bitc-dev
mailing list