[plt-scheme] inheriting dynamic extent

From: Jim Blandy (jimb at redhat.com)
Date: Sat Apr 2 17:44:47 EST 2005

Jim Blandy <jimb at redhat.com> writes:
>     ;; Return a value that represents the current dynamic context.
>     (define (capture-context)
>       (call/cc (lambda (k1)
>                  ;; Don't miss the double parens!
>                  ((call/cc (lambda (k2) (k1 k2)))))))

Or, less clumsily:

(define (capture-context)
  ;; Don't miss the double parens!
  ((call/cc (lambda (k) (lambda () k)))))



Posted on the users mailing list.