From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.bugs Subject: Re: GIT version: values writing Date: Thu, 20 Jan 2011 22:18:22 +0100 Message-ID: <87mxmve0kh.fsf@gnu.org> References: <87fwsnzju6.fsf@gnu.org> <140431E4-7361-4F1B-A0E4-199E1272E67A@telia.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1295558414 22594 80.91.229.12 (20 Jan 2011 21:20:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 20 Jan 2011 21:20:14 +0000 (UTC) Cc: bug-guile@gnu.org To: Hans Aberg Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Thu Jan 20 22:20:09 2011 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Pg1vL-0002FA-Fu for guile-bugs@m.gmane.org; Thu, 20 Jan 2011 22:20:07 +0100 Original-Received: from localhost ([127.0.0.1]:37368 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pg1vK-0005TP-Vk for guile-bugs@m.gmane.org; Thu, 20 Jan 2011 16:20:07 -0500 Original-Received: from [140.186.70.92] (port=33858 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pg1ti-0004fW-30 for bug-guile@gnu.org; Thu, 20 Jan 2011 16:18:27 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pg1tg-0007Ud-Pj for bug-guile@gnu.org; Thu, 20 Jan 2011 16:18:25 -0500 Original-Received: from mail1-relais-roc.national.inria.fr ([192.134.164.82]:26239) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pg1tg-0007UH-JM for bug-guile@gnu.org; Thu, 20 Jan 2011 16:18:24 -0500 X-IronPort-AV: E=Sophos;i="4.60,353,1291590000"; d="scan'208";a="96104968" Original-Received: from reverse-83.fdn.fr (HELO nixey) ([80.67.176.83]) by mail1-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 20 Jan 2011 22:18:23 +0100 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 1 =?iso-8859-1?Q?Pluvi=F4se?= an 219 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu In-Reply-To: <140431E4-7361-4F1B-A0E4-199E1272E67A@telia.com> (Hans Aberg's message of "Thu, 20 Jan 2011 17:51:51 +0100") User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:4991 Archived-At: Hi, Hans Aberg writes: > On 20 Jan 2011, at 16:16, Ludovic Court=C3=A8s wrote: > >>> There seems to be a bug in GIT version when writing the 'values' data >>> type. >>> (list 2 (values 3 4) 5) >>> $1 =3D (2 3 5) >> >> This behavior is correct: in Guile 1.9, multiple-value returns are >> truncated any time the continuation expects fewer values. >> >> Here, the =E2=80=98values=E2=80=99 call returns 3 values, but the locati= on where it=E2=80=99s >> called expects only 1, hence the automatic truncation. > > After the post, I saw that R5RS says the behavior is undefined. > > However, quietly loosing values is inviting bugs. I may seem sloppy, but I find it convenient. In the c.l.s thread you mentioned, Joe Marshall writes: With the current system, if you wish to add an extra return value, you have to adjust the code at *every* return site (provided you can enumerate all the return sites!). In Common Lisp, unexpected return values are silently discarded, so modifying a function to return extra information is a local change. Discarding the extra return values is somewhat sloppy semantically, but far more convenient from a coding standpoint. >>> with the value 4 lost In guile-1.8.8, it would write >>> (2 # 5) >> >> The special =E2=80=9Cvalues=E2=80=9D type in older Guile versions was an= artifact of >> Guile=E2=80=99s implementation of multiple value support; objects of tha= t type >> are normally invisible to user code, but they would show up in such >> situations (R5RS doesn=E2=80=99t specify what to do in these cases, so i= t was >> valid, but implementation-specific behavior.) > > The old style is a reification of the values, and could be turned into > a tuples object. The latter is what I am implementing, but I can make > my own type instead. > > It is discussed here, along with some other ideas. > > https://groups.google.com/group/comp.lang.scheme/browse_thread/thread/b72= d987aa6626cd2/e2f7cfa55fb51d55?hl=3Den Interesting thread. Thanks, Ludo=E2=80=99.