"Rick Hanson" <rick@tamos.net> writes:
> I think the "standard way" is to use call/cc (although I'm not an
> expert).
No. NOOO.
The "standard way" to jump out of a loop is to write it using explicit
tail recursion, and just not jump back into it.
"Rick Hanson" <rick@tamos.net> writes:
> (define call/cc call-with-current-continuation)
>
> (define (test1)
> (let loop0 ((x 1))
> (call/cc
> (lambda (k)
> (let loop1 ((y x))
> (if (= y 5)
> (k y)
> (loop1 (+ y 1))))))))
(define (test1)
(let loop1 ((y 1))
(if (= y 5)
y
(loop1 (+ y 1)))))
--
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla
|