[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Scheme-reports] 6.1 Exceptions needs examples

* Aaron W. Hsu [2012-03-21 19:45] writes:

> I can share my thoughts on this one...
> On Wed, 2012-03-21 at 07:49 +0100, Helmut Eller wrote:
>> (let ((events '()))
>>    (guard (c 
>>            (#t #f))
>>      (guard (c
>>              ((dynamic-wind 
>>                   (lambda () (set! events (cons 'c events)))
>>                   (lambda () #f)
>>                   (lambda () (set! events (cons 'd events))))
>>               #f))
>>        (dynamic-wind 
>>            (lambda () (set! events (cons 'a events)))
>>            (lambda () (raise 'error))
>>            (lambda () (set! events (cons 'b events))))))
>>    (reverse events)) 
> Let's keep in mind the text of the standard, which should match that of
> R6RS for this case, and therefore, we can test any Scheme implementation
> claiming to conform to R6RS to see if we get what we expect.
> This gives '(a b c d a b) as the only valid result. 

Thanks, for clearing this up.  That was also my interpretation of R6RS.
I'd like to note, that this example requires full continuations since a
and b occur two times in the event trace


Scheme-reports mailing list