[r6rs-discuss] [Formal] Allow compilers to reject obvious
aghuloum at cs.indiana.edu
Tue Feb 27 20:24:35 EST 2007
On Feb 27, 2007, at 1:51 PM, Jed Davis wrote:
> On Thu, Feb 22, 2007 at 09:06:02PM -0500, William D Clinger wrote:
>> The current draft legitimizes many situations that,
>> according to the R5RS, are clear errors. The draft
>> generally does this by requiring all implementations
>> to raise a &violation exception when the situation
>> arises. That allows portable programs to implement
>> an arbitrarily bizarre semantics for the violation
>> via inappropriate exception handlers.
> How arbitrarily bizarre?
I don't know what Will Clinger has in mind, but here is my response.
It can get very bizarre. Imagine the following code (written for
but translatable to R6RS's exceptions mechanism):
(define (fact n)
(define result 1)
(lambda (who str what)
(when (= n 0) (k result))
(set! result (* result n))
(set! n (- n 1))
(let f ()
I will leave it to the reader to puzzle out why this computes factorial.
I think we all agree that this qualifies as "abuse" to the exception
(a sport I might actually enjoy in my spare time, and would
fired for if I do it at work). But then what?
More information about the r6rs-discuss