unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: Hans Aberg <haberg-1@telia.com>
Cc: bug-guile <bug-guile@gnu.org>
Subject: Re: (+ (values 1 2)) should be 1
Date: Tue, 24 May 2011 15:11:19 +0200	[thread overview]
Message-ID: <m3hb8knszs.fsf@unquote.localdomain> (raw)
In-Reply-To: <A46D4F28-1BC9-486C-8CED-E657E0E7751D@telia.com> (Hans Aberg's message of "Tue, 24 May 2011 12:35:36 +0200")

On Tue 24 May 2011 12:35, Hans Aberg <haberg-1@telia.com> writes:

> On 23 May 2011, at 15:49, Andy Wingo wrote:
>
>>>> But, it is 1 and 2, currently.  (+ FOO) inlines just to FOO, too
>>>> optimistically.
>>> 
>>> It is unspecified according to rsr5.
>> 
>> I know.  I'm talking about Guile here.
>
> The Guile manual, sec. 10.2.5.2, says that SCM_UNSPECIFIED is to be used when the Scheme standard says the return is an unspecified value.
>
> So this Lisp extension breaks off from that. If one wants it, perhaps, there should be some way to invoke it.

Hans, you are misreading.  (+ 1) is 1 according to the R5RS.  (+ "foo")
is an error.  (+ (values 1 2)) is unspecified, as an instance of
returning an unexpected number of values to a continuation, but it is
not an instance of the unspecified value.

When a continuation that expects one value receives more values than it
is expecting -- e.g., the <> in (+ <>) expects one value -- Guile
truncates those values to the first one.  If such a continuation
receives 0 values, Guile signals an error.

Andy
-- 
http://wingolog.org/



  reply	other threads:[~2011-05-24 13:11 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-22 14:02 (+ (values 1 2)) should be 1 Andy Wingo
2011-05-23 13:34 ` Hans Aberg
2011-05-23 13:49   ` Andy Wingo
2011-05-23 13:58     ` Hans Aberg
2011-05-24 10:35     ` Hans Aberg
2011-05-24 13:11       ` Andy Wingo [this message]
2011-05-24 13:48         ` Hans Aberg
2011-05-24 15:07           ` Andy Wingo
2011-05-24 16:13             ` Hans Aberg
2011-05-25  0:25               ` Mark H Weaver
2011-05-25  8:41                 ` Hans Aberg
2011-05-25 16:54                   ` Mark H Weaver
2011-05-25 17:10                     ` Hans Aberg
2011-06-17 17:43 ` 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=m3hb8knszs.fsf@unquote.localdomain \
    --to=wingo@pobox.com \
    --cc=bug-guile@gnu.org \
    --cc=haberg-1@telia.com \
    /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).