[r6rs-discuss] [Formal] Allow compilers to reject obvious violations

Abdulaziz Ghuloum aghuloum at cs.indiana.edu
Wed Feb 28 00:22:28 EST 2007


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


More information about the r6rs-discuss mailing list