On Feb 27, 2007, at 11:19 PM, Robby Findler wrote:
>
> But how can we puzzle that out -- parameterize isn't in r6. Can you
> rewrite that with with-exception-handler ?
This takes the fun out of it. Oh well, here is an approximation:
(define (fact n)
(define result 1)
(define what #f)
(call/cc
(lambda (k)
(with-exception-handler
(lambda (_)
(when (= n 0) (k result))
(set! result (* result n))
(set! n (- n 1))
(what))
(lambda ()
(let f ()
(call/cc
(lambda (k)
(set! what k)
(car what)))
(f)))))))
Aziz,,,
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.r6rs.org/pipermail/r6rs-discuss/attachments/20070228/f05c38f4/attachment.html
Received on Wed Feb 28 2007 - 00:22:28 UTC