[plt-scheme] Exiting the current context

From: Vijay Mathew (vijay.the.schemer at gmail.com)
Date: 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://lists.racket-lang.org/users/archive/attachments/20090204/d6d7df4b/attachment.html>

Posted on the users mailing list.