From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.lisp.guile.bugs Subject: bug#17474: Making *unspecified* equivalent to (values) would seem convenient Date: Mon, 12 May 2014 21:49:43 +0200 Message-ID: <877g5qvktk.fsf@fencepost.gnu.org> References: <87r43zuswp.fsf@fencepost.gnu.org> <8738gfyoxm.fsf@gnu.org> <87iopbue6m.fsf@fencepost.gnu.org> <87egzyajm2.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1399924286 11361 80.91.229.3 (12 May 2014 19:51:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 12 May 2014 19:51:26 +0000 (UTC) Cc: 17474@debbugs.gnu.org To: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Mon May 12 21:51:16 2014 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WjwFm-0003Hb-8K for guile-bugs@m.gmane.org; Mon, 12 May 2014 21:51:14 +0200 Original-Received: from localhost ([::1]:39570 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjwFl-000065-TT for guile-bugs@m.gmane.org; Mon, 12 May 2014 15:51:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41937) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjwFi-00005i-CF for bug-guile@gnu.org; Mon, 12 May 2014 15:51:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WjwFa-00031L-Nf for bug-guile@gnu.org; Mon, 12 May 2014 15:51:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43782) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjwFa-000313-LL for bug-guile@gnu.org; Mon, 12 May 2014 15:51:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WjwFa-0007oM-7V for bug-guile@gnu.org; Mon, 12 May 2014 15:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: David Kastrup Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Mon, 12 May 2014 19:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17474 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 17474-submit@debbugs.gnu.org id=B17474.139992425530011 (code B ref 17474); Mon, 12 May 2014 19:51:02 +0000 Original-Received: (at 17474) by debbugs.gnu.org; 12 May 2014 19:50:55 +0000 Original-Received: from localhost ([127.0.0.1]:32900 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WjwFT-0007nz-5E for submit@debbugs.gnu.org; Mon, 12 May 2014 15:50:55 -0400 Original-Received: from fencepost.gnu.org ([208.118.235.10]:47299 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WjwFQ-0007nr-T1 for 17474@debbugs.gnu.org; Mon, 12 May 2014 15:50:53 -0400 Original-Received: from localhost ([127.0.0.1]:54605 helo=lola) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjwFP-0007rE-Ik; Mon, 12 May 2014 15:50:51 -0400 Original-Received: by lola (Postfix, from userid 1000) id 21474E0F55; Mon, 12 May 2014 21:49:43 +0200 (CEST) In-Reply-To: <87egzyajm2.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Mon, 12 May 2014 21:21:25 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-guile@gnu.org 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:7457 Archived-At: ludo@gnu.org (Ludovic Court=C3=A8s) writes: > David Kastrup skribis: > >> ludo@gnu.org (Ludovic Court=C3=A8s) writes: >> >>> R5RS defines =E2=80=98values=E2=80=99 as: >>> >>> (define (values . things) >>> (call-with-current-continuation >>> (lambda (cont) (apply cont things)))) >>> >>> Thus, a conforming implementation must raise a run-time error when the >>> continuation of a (values) form expects one or more values. >> >> No. From R5RS: >> >> -- procedure: call-with-current-continuation proc >> >> [...] >> >> The escape procedure accepts the same number of arguments as the >> continuation to the original call to >> call-with-current-continuation. Except for continuations created >> by the `call-with-values' procedure, all continuations take >> exactly one value. The effect of passing no value or more than >> one value to continuations that were not created by >> call-with-values is unspecified. > > Oh indeed, I stand corrected. > >> So this behavior is neither out of line, nor against the standard. It >> is merely a more convenient behavior for a situation that the standard >> left unspecified. > > Right. > > I=E2=80=99m not completely convinced it makes sense to =E2=80=9Cspecify= =E2=80=9D the zero values > case in this way, but I=E2=80=99d like to hear what others think. The real awkwardness is not when feeding (values) to a single-value continuation but rather the ability of single-value expressions being able to pass zero values to a multi-value continuation. In Guilev1, there was a lot of those around, and indeed (call-with-values (lambda () (car (list (values)))) list) =3D> () in Guilev1. But in Guile 2.0.9, I actually get the same, and I don't think people reported bugs for that. This design does not win a beauty contest. But at least it fits several parts of Guile and the API together in a less ugly and more satisfactory manner than before while providing a really large amount of backward compatibility. I don't really know whether there are assumptions in the compiler it might break. So this change would certainly also want testing with large applications and should not be introduced shortly before a stable release. --=20 David Kastrup