16 Jun 2012 08:39
exit continuation doesn't like multiple values
Stephen Lewis <lewis+gauche <at> freeshell.org>
2012-06-16 06:39:47 GMT
2012-06-16 06:39:47 GMT
Shiro,
I tried to pass multiple values to an exit continuation and it doesn't
seem to work. Is this a bug or is this not allowed?
gosh> (gauche-version)
"0.9.2"
gosh> (define (multiple x y z)
(call/cc
(lambda (escape)
(if (zero? x)
(escape (values 3.0 2.0 1.0))
(values x y z)))))
multiple
gosh> (multiple 11 22 33)
11
22
33
gosh> (multiple 0 1 2)
3.0
gosh>
I expected to get 3 values 3.0 2.0 1.0 but got only the first one.
Guile does what I expect,
guile> (version)
"1.8.8"
guile> (define (multiple x y z)
... (call/cc
(Continue reading)
Racket is not a teaching environment.
RSS Feed