[plt-scheme] Re: Semantics of ec?

From: Robby Findler (robby at cs.uchicago.edu)
Date: Thu Feb 16 13:56:36 EST 2006

Full continuations, dynamic-wind, etc don't seem to be required (as you
might expect if you look at mzscheme's implementation or Matthias's
CCF: http://people.cs.uchicago.edu/~robby/ccf/ ).

Anyways, is this what you're looking for?

  ;; throw to an escaping continuation
  (in-hole E_1 (call/ec (lambda (x_1) (in-hole E_2 (x_1 v_1)))))
  -->
  (in-hole E_1 v_1)

  ;; invalidate an escaping continuation 
  ;; that is trying to be a full one
  (in-hole E_1 (call/ec (lambda (x_1) v_1)))
  -->
  (in-hole E_1 ((lambda (x_1) v_1) (lambda (ignore) (error))))

  ;; abort the program when hitting an error
  (in-hole E_1 (error))
  -->
  "error"

I've also attached a PLT Redex version of it with a little bit bigger
language if you want to play around with it. Enjoy.

Robby
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: callec.ss
URL: <http://lists.racket-lang.org/users/archive/attachments/20060216/320e038c/attachment.ksh>

Posted on the users mailing list.