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: Sun, 22 Jun 2014 08:09:14 +0200 Message-ID: <87zjh5cw6t.fsf@fencepost.gnu.org> References: <87r43zuswp.fsf@fencepost.gnu.org> <8738gfyoxm.fsf@gnu.org> <87iopbue6m.fsf@fencepost.gnu.org> <87egzyajm2.fsf@gnu.org> <87iontwm5m.fsf@yeeloong.lan> 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 1403417417 18241 80.91.229.3 (22 Jun 2014 06:10:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 22 Jun 2014 06:10:17 +0000 (UTC) Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , 17474@debbugs.gnu.org To: Mark H Weaver Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sun Jun 22 08:10:10 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 1Wyayg-0004ak-1G for guile-bugs@m.gmane.org; Sun, 22 Jun 2014 08:10:10 +0200 Original-Received: from localhost ([::1]:47726 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wyayf-0002xz-Ia for guile-bugs@m.gmane.org; Sun, 22 Jun 2014 02:10:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46774) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wyayb-0002t6-7R for bug-guile@gnu.org; Sun, 22 Jun 2014 02:10:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wyaya-0006KR-BK for bug-guile@gnu.org; Sun, 22 Jun 2014 02:10:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37219) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wyaya-0006KB-81 for bug-guile@gnu.org; Sun, 22 Jun 2014 02:10:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WyayZ-0004yw-GD for bug-guile@gnu.org; Sun, 22 Jun 2014 02:10:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: David Kastrup Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sun, 22 Jun 2014 06:10:03 +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.140341737819108 (code B ref 17474); Sun, 22 Jun 2014 06:10:03 +0000 Original-Received: (at 17474) by debbugs.gnu.org; 22 Jun 2014 06:09:38 +0000 Original-Received: from localhost ([127.0.0.1]:56600 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wyay9-0004y6-V9 for submit@debbugs.gnu.org; Sun, 22 Jun 2014 02:09:38 -0400 Original-Received: from fencepost.gnu.org ([208.118.235.10]:34904 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wyay4-0004xj-J8 for 17474@debbugs.gnu.org; Sun, 22 Jun 2014 02:09:36 -0400 Original-Received: from localhost ([127.0.0.1]:42208 helo=lola) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wyay2-000581-VV; Sun, 22 Jun 2014 02:09:31 -0400 Original-Received: by lola (Postfix, from userid 1000) id 19BDDE051A; Sun, 22 Jun 2014 08:09:15 +0200 (CEST) In-Reply-To: <87iontwm5m.fsf@yeeloong.lan> (Mark H. Weaver's message of "Sun, 22 Jun 2014 01:25:41 -0400") 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:7510 Archived-At: Mark H Weaver writes: > ludo@gnu.org (Ludovic Court=C3=A8s) writes: >> 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. > > I'm strongly opposed to having core Guile mechanisms automatically > convert between SCM_UNSPECIFIED and zero values, which is part of what > David's patch set does. I'd be glad to explain the reasons for my > position in a later message, but I don't have time right now. > > However, I'm (cautiously) open to the idea of changing (if #f x) and > some other things to return (values) instead of *unspecified*. I agree > that it would be cleaner, though I worry about backward compatibility > issues. The C API recommends using SCM_UNSPECIFIED here. That was never different. Consolidating this will not really work without declaring SCM_UNSPECIFIED and consequently *unspecified* the same as (values). This strategy is also sketched in a comment by Andy where *unspecified* is defined. What this patch does for backward compatibility reasons is treating *unspecified* as an immediate value in single-value contexts. This will likely always be the case in the C API where all calls of "values" are sort of half-transparent anyway. It is conceivable to eventually deprecate this use in Scheme proper. This won't be doable without a migration strategy. The conversions this patch uses in the Scheme/VM layer are such a migration strategy. Step=C2= =A01 would be this patch. Step=C2=A02 would be putting out deprecation warnings. Step=C2=A03 would be removing the automatic conversions. Compatibility considerations will make the last two steps a large hurdle. I don't see a better step=C2=A01 towards the goal of letting (if #f x) return (values). I readily agree that this is a mess. Where we disagree is in the culprit. You consider this patch the cause of the mess, I consider this patch consolidation of the SCM_UNSPECIFIED/*unspecified* mess already designed into GUILE. > It would have to be done between major releases. In the current form of the patch, it's surprisingly backwards compatible but of course one would not call it a mere bug fix. It will take a number of major releases to get more than step=C2=A01 done. But every journey starts with the first step. --=20 David Kastrup