[plt-scheme] Exiting the current context

Vijay Mathew vijay.the.schemer at gmail.com
Wed Feb 4 08:04:51 EST 2009


Hi all,

I am not sure if the term "current context" is what it should be. Anyway,
here is what I like to accomplish:

(define (suspend func)
    (call/cc
        (lambda (k)
            (save-k)
            (func)
            (exit-current-context))))

(define (run)
   (suspend my-func)  ;; (run) should return here, as a result of
(exit-current-context)
   ;; When continuation saved by (suspend) is invoked, (run) should resume
at (do-something).
   (do-something))

How can I implement (exit-current-context)??

Thanks in advance,

-- Vijay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090204/d6d7df4b/attachment.htm


More information about the plt-scheme mailing list