Re: coroutines and continuations ( in Python? - long discussion )

Steven Miale (smiale@cs.indiana.edu)
Tue, 3 May 1994 16:35:04 -0500

In article <199405031639.AA19813@elvis.med.virginia.edu>,
Steven D. Majewski <sdm7g@elvis.med.virginia.edu> wrote:
>To quote Kent Dybvig:
>
> ( let ([x (call/cc (lambda (k) k))])
> (x (lambda (ignore) "hi"))) ==> "hi"

But Dan Friedman says...

(define receiver
(lambda (continuation)
(continuation continuation)))

(define tester
(lambda (continuation)
(writeln "beginning")
(call/cc continuation)
(writeln "middle")
(call/cc continuation)
(writeln "end")))

(tester (call/cc receiver)) =>
beginning
beginning
middle
beginning
end

We call it "Mondo Bizarro."

Steve "CPS that" Miale

-- 
Steven Miale - smiale@cs.indiana.edu | Don't blame me - 
Indiana University, Bloomington, IN  | I voted Libertarian.