bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#14347: reset, shift, continuation values truncated inconsistently


From: Jussi Piitulainen
Subject: bug#14347: reset, shift, continuation values truncated inconsistently
Date: 04 May 2013 10:47:15 +0300
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Hi, the following seems at least inconsistent to
me and possibly unintended: I believe it
demonstrates that the continuation captured by
`shift' passes all its values to its continuation
when it's called directly, but truncates them to
the first value when it's bound to a variable
outside the reset expression and then called.

The documentation for reset and shift in the
manual does not quite say, but I believe the
captured continuation in these examples should be
the continuation of the shift expression inside
the reset expression, that is, it should simply
return the three values in all cases.

GNU Guile 2.0.5-deb+1-3
Copyright (C) 1995-2012 Free Software Foundation, Inc.
...
Enter `,help' for help.
scheme@(guile-user)> (use-modules (ice-9 control))
scheme@(guile-user)> (reset (shift k (k)) (values 3.1 2 3))
$1 = 3.1
$2 = 2
$3 = 3
scheme@(guile-user)> ((reset (shift k k) (values 3.1 2 3)))
$4 = 3.1
$5 = 2
$6 = 3
scheme@(guile-user)> (let ((k (reset (shift k k) (values 3.1 2 3)))) (k))
$7 = 3.1
scheme@(guile-user)> (define k (reset (shift k k) (values 3.1 2 3)))
scheme@(guile-user)> (k)
$8 = 3.1
scheme@(guile-user)> (k)
$9 = 3.1

(I installed guile-2.0 with apt-get on Ubuntu and got this.)






reply via email to

[Prev in Thread] Current Thread [Next in Thread]