Armando Blancas <
abm2...@gmail.com> wrote:
> I'm going through some examples in the Scheme wiki and the Scheme
> Programming Language 4th Ed., and came upon:
>
> (define return #f)
>
> (+ 1 (call/cc
> (lambda (cont)
> (set! return cont)
> 1)))
>
> (return 22) => 23
>
> All fine, until I put this in a script. In Gambit, Chicken and
> Scheme48 the script goes into an infinite loop when I try to load
> it. [...]
My guess would be that the result of this program depends
on REPL semantics, which is a gaping hole in the formal
specification of all Schemes up to and including R5RS.
What is the continuation of (+ 1 (call/cc ...)) in your example?
What is the continuation when you package your program in a BEGIN?
--
Nils M Holm < n m h @ t 3 x . o r g >
www.t3x.org