On Feb 25, 2007, at 2:32 PM, Matthias Felleisen wrote:


On Feb 25, 2007, at 12:00 PM, Will Clinger wrote:

Requiring compiler writers to write
this extra code, instead of allowing them to reject
programs that violate the basic requirements of the
language, is a silly waste of implementors' time.

I consider it a silly waste of time for (hopefully) many more Scheme programmers than compiler writers to having to guess why a program was rejected by a compiler that is supposedly R6RS conforming. If the rules are spelled out in one place and in an explicit manner, a compiler (writer) can refer programmers there and the programmer can work around the restrictions.

I agree. What I would hate is to leave it up to the implementors to decide what to reject and what to accept and thus forcing the programmer to obstruct the code in ways to inhibit the compiler's optimizations that caused a program to be rejected.

Working from the previous example:

In one implementation, we found that:

> (call-with-current-continuation
     (lambda (k) ((lambda () 12) (k 17))))
17


In another, we found that:

> (call-with-current-continuation
     (lambda (k) ((lambda () 12) (k 17))))
Error: Wrong number of arguments to known procedure (let () 12)
Entering debugger; type "?" for help.
debug>

But we can fool the implementation into compiling the same expression by inserting a dummy "let" around (lambda () 12):

> (call-with-current-continuation
     (lambda (k) ((let () (lambda () 12)) (k 17))))
12
>

Oh wait!

Aziz,,,

PS.  I apologize for my usenet-like responses.


_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss

Reply via email to