From: Jussi Piitulainen <jpiitula@ling.helsinki.fi>
To: 14347@debbugs.gnu.org
Subject: bug#14347: reset, shift, continuation values truncated inconsistently
Date: 04 May 2013 10:47:15 +0300 [thread overview]
Message-ID: <qot8v3vuqyk.fsf@ruuvi.it.helsinki.fi> (raw)
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.)
next reply other threads:[~2013-05-04 7:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-04 7:47 Jussi Piitulainen [this message]
2013-05-06 19:06 ` bug#14347: reset, shift, continuation values truncated inconsistently Ian Price
2013-05-06 21:15 ` Stefan Israelsson Tampe
2016-06-20 21:06 ` Andy Wingo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=qot8v3vuqyk.fsf@ruuvi.it.helsinki.fi \
--to=jpiitula@ling.helsinki.fi \
--cc=14347@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).