Path: utzoo!attcan!uunet!snorkelwacker!tut.cis.ohio-state.edu!pt.cs.cmu.edu!andrew.cmu.edu!bobg+ From: bobg+@andrew.cmu.edu (Robert Steven Glickstein) Newsgroups: comp.lang.scheme Subject: Re: call/cc Message-ID: Date: 10 Mar 90 16:32:50 GMT References: <1990Mar8.064319.28399@brutus.cs.uiuc.edu>, <38402@iuvax.cs.indiana.edu> Distribution: comp Organization: Information Technology Center, Carnegie Mellon, Pittsburgh, PA Lines: 20 In-Reply-To: <38402@iuvax.cs.indiana.edu> When I was first trying to grok continuations as a Scheme novitiate, I found the sequence below very enlightening. Try to understand what's going on here; I'll post a detailed description in a day or two. > (define (identity-fn x) x) > (define (current-continuation) (call/cc identity-fn)) > (define foo (current-continuation)) > foo #[Continuation] > (foo 10) > foo 10 ______________ Bob Glickstein | Internet: bobg@andrew.cmu.edu Information Technology Center | Bitnet: bobg%andrew@cmuccvma.bitnet Carnegie Mellon University | UUCP: ...!harvard!andrew.cmu.edu!bobg Pittsburgh, PA 15213-3890 | (412) 268-6743 | Sinners can repent, but stupid is forever