On Feb 25, 2007, at 4:05 AM, Michael Sperber wrote:
>
> William D Clinger <will_at_ccs.neu.edu> writes:
>
>> Several extant Scheme compilers already perform static
>> analyses that can occasionally establish that some
>> expression would inevitably raise a &violation exception
>> were the expression ever to be executed. The R6RS
>> library system will make it much easier for compilers
>> to detect such violations at compile time.
>
> Could you provide some examples where you consider this useful? I
> know they exist, but it would help me understand your position if I
> knew some examples for problems you're trying to solve.
Here's one I find useful occasionally: doing arity checking ahead of
time. Larceny will do this for "known procedures." [1]
% larceny
Larceny v0.93 "Deviated Prevert" (Nov 10 2006 04:27:45, precise:BSD
Unix:unified)
> (let* ((f (lambda (a b) 3)) (g (lambda () (f 4)))) g)
Error: Wrong number of arguments to known procedure ((begin .f|3) '4)
Entering debugger; type "?" for help.
debug>
[1]
http://www.ccs.neu.edu/home/will/Twobit/p2background.html#known
Received on Sun Feb 25 2007 - 04:24:53 UTC