From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Hans Aberg Newsgroups: gmane.lisp.guile.bugs Subject: Re: (+ (values 1 2)) should be 1 Date: Tue, 24 May 2011 15:48:32 +0200 Message-ID: <6B109ACE-F9E4-463D-8314-A19CC40D5B50@telia.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1306244961 12188 80.91.229.12 (24 May 2011 13:49:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 24 May 2011 13:49:21 +0000 (UTC) Cc: bug-guile To: Andy Wingo Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Tue May 24 15:49:16 2011 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QOrz2-00051T-DB for guile-bugs@m.gmane.org; Tue, 24 May 2011 15:49:16 +0200 Original-Received: from localhost ([::1]:45024 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOrz1-0007bI-P2 for guile-bugs@m.gmane.org; Tue, 24 May 2011 09:49:15 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:56818) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOryz-0007b1-JA for bug-guile@gnu.org; Tue, 24 May 2011 09:49:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QOryy-0001AL-RQ for bug-guile@gnu.org; Tue, 24 May 2011 09:49:13 -0400 Original-Received: from smtp-out12.han.skanova.net ([195.67.226.212]:48463) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOryy-0001AA-Ep for bug-guile@gnu.org; Tue, 24 May 2011 09:49:12 -0400 Original-Received: from [10.0.1.2] (217.210.127.13) by smtp-out12.han.skanova.net (8.5.133) (authenticated as u26619196) id 4D65154401AAA550; Tue, 24 May 2011 15:48:33 +0200 In-Reply-To: X-Mailer: Apple Mail (2.1084) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 195.67.226.212 X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:5613 Archived-At: On 24 May 2011, at 15:11, Andy Wingo wrote: >>>>> But, it is 1 and 2, currently. (+ FOO) inlines just to FOO, too >>>>> optimistically. >>>>=20 >>>> It is unspecified according to rsr5. >>>=20 >>> I know. I'm talking about Guile here. >>=20 >> 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. >>=20 >> So this Lisp extension breaks off from that. If one wants it, = perhaps, there should be some way to invoke it. >=20 > 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. Andy, I think (values 1 2) should here return SCM_UNSPECIFIED first = argument to '+', so that people will know that the standard does leave = the value unspecified. > 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. So here I think one should enable some kind of Lisp-extension to get = that. There is no guarantee that Guile will not change again unless doing = something like that. So it is useless for regular programming. Hans