On 12/10/10 22:09, John Cowan wrote:
> Thomas Chust scripsit:
>
>> few Scheme compilers would report (cons (x)) as a compile time error
>> for lack of static type information.
>
> You don't need any, unless you are prepared to handle reassigning (as
> opposed to rebinding) the name.  As long as cons is not locally rebound,
> you know it takes two arguments, and if it is locally rebound, you still
> know how many arguments it takes if it is bound to a lambda, and can
> blow it off if it is not.  If that counts as static type information,
> it's a pretty minimal variety.

I would also be concerned about how to efficiently implement this...

If (foo (a) (b) (c)) is to be compiled without values-splicing, it's
easy enough to arrange for the return value of (a) to end up wherever
the first argument of (foo ...) should go, and so on.

With value-splicing, unless we can tell in advance (through difficult
analysis) how many values each of (a), (b) and (c) return, we'd need to
collect them together at run time and then put them into the activation
record for (foo ...).

ABS

--
Alaric Snell-Pym
http://www.snell-pym.org.uk/alaric/

_______________________________________________
Chicken-hackers mailing list
Chicken-hackers@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-hackers

Reply via email to