[MSLUG] Concerns about the behavior of call/cc

Stefan Monnier monnier at iro.umontreal.ca
Wed Apr 30 01:20:18 EDT 2008


> 2.2- this means: try to execute (lambda (k)(exit k))
>       where k is the continuation (lambda (v) (apply v '(1 2 3))

Actually, the continuation k is more like

   (lambda (v) (exit (apply v '(1 2 3))))

Because if the argument to call/cc does not call the continuation
explicitly and instead just returns a value, that value is then passed
to the continuation.  I.e.

 (call/cc (lambda (v) e))

is really more like

 (call/cc (lambda (v) (v e)))

This is not inherent to the notion of continuation, it just happens to
be the way the call/cc in Scheme was chosen to work.


        Stefan


More information about the MSLUG mailing list