From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Chris K. Jester-Young" Newsgroups: gmane.lisp.guile.devel Subject: Re: when and unless Date: Thu, 8 Dec 2011 10:34:17 -0500 Message-ID: <20111208153417.GC15815@yarrow.destinee.acro.gen.nz> References: <87mxb6kkzx.fsf@fencepost.gnu.org> <877h29oeeq.fsf@pobox.com> <877h29k5xs.fsf@fencepost.gnu.org> <8739cxob6z.fsf@pobox.com> <87y5upicaf.fsf@fencepost.gnu.org> <20111206230556.GA14717@yarrow.destinee.acro.gen.nz> <87liqoivle.fsf@fencepost.gnu.org> <20111207155834.GA15815@yarrow.destinee.acro.gen.nz> <87liqno3nn.fsf@fencepost.gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1323358482 5917 80.91.229.12 (8 Dec 2011 15:34:42 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 8 Dec 2011 15:34:42 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Dec 08 16:34:37 2011 Return-path: Envelope-to: guile-devel@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 1RYfzV-00065X-2O for guile-devel@m.gmane.org; Thu, 08 Dec 2011 16:34:33 +0100 Original-Received: from localhost ([::1]:37372 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RYfzR-0004eK-KX for guile-devel@m.gmane.org; Thu, 08 Dec 2011 10:34:29 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:51130) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RYfzP-0004eF-70 for guile-devel@gnu.org; Thu, 08 Dec 2011 10:34:28 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RYfzO-0006AE-Dn for guile-devel@gnu.org; Thu, 08 Dec 2011 10:34:27 -0500 Original-Received: from mail-yx0-f169.google.com ([209.85.213.169]:35832) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RYfzO-0006A9-BH for guile-devel@gnu.org; Thu, 08 Dec 2011 10:34:26 -0500 Original-Received: by yenq10 with SMTP id q10so1925553yen.0 for ; Thu, 08 Dec 2011 07:34:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=EUt/eKebX3mrAgcZCDoE6h/mocKaq+bNARSpZQWVucs=; b=TWHKkLak/ZY8zvPcsMZIRu9iZxzdPWMQSKJ0suI60pVWRCojAMKkBwF9gpiPRaAYmD 960YpCXBaD4VZ70HHZXpdBBJHGzci7+vvZy9sFQTQlf4j8AJ7FVHUbcu9AqY2xiNCdY+ a0QdnuEc+FB972rEVYx4aHU5aeqW0n2z0NXpI= Original-Received: by 10.236.77.232 with SMTP id d68mr5445119yhe.98.1323358465603; Thu, 08 Dec 2011 07:34:25 -0800 (PST) Original-Received: from yarrow.destinee.acro.gen.nz (mf42c36d0.tmodns.net. [208.54.44.244]) by mx.google.com with ESMTPS id l27sm15325167ani.21.2011.12.08.07.34.23 (version=SSLv3 cipher=OTHER); Thu, 08 Dec 2011 07:34:24 -0800 (PST) Mail-Followup-To: guile-devel@gnu.org Content-Disposition: inline In-Reply-To: <87liqno3nn.fsf@fencepost.gnu.org> User-Agent: Mutt/1.5.20 (2009-06-14) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.213.169 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:13016 Archived-At: On Thu, Dec 08, 2011 at 09:42:36AM +0100, David Kastrup wrote: > So here is another proposal: (values) is not the same as *unspecified*. > But if you take the first value of a values list in single-value > contexts, there is nothing about that coercion mechanism that would keep > you from using *unspecified* whenever that values list would be empty. That's easy to implement (patch at bottom of post; I tested it). The question for the people on the list to decide is whether it's a good idea. :-) Personally, I don't object to it, but, perhaps others do. Cheers, Chris. * * * diff --git a/libguile/vm-i-system.c b/libguile/vm-i-system.c index 474fe78..6ce5ee3 100644 --- a/libguile/vm-i-system.c +++ b/libguile/vm-i-system.c @@ -1311,7 +1311,7 @@ VM_DEFINE_INSTRUCTION (68, return_values, "return/values", 1, -1, -1) /* Finally null the end of the stack */ NULLSTACK (vals + nvalues - sp); } - else if (nvalues >= 1) + else { /* Multiple values for a single-valued continuation -- here's where I break with guile tradition and try and do something sensible. (Also, @@ -1324,13 +1324,11 @@ VM_DEFINE_INSTRUCTION (68, return_values, "return/values", 1, -1, -1) fp = SCM_FRAME_DYNAMIC_LINK (fp); /* Push first value */ - *++sp = vals[1]; + *++sp = nvalues >= 1 ? vals[1] : SCM_UNSPECIFIED; /* Finally null the end of the stack */ NULLSTACK (vals + nvalues - sp); } - else - goto vm_error_no_values; /* Restore the last program */ program = SCM_FRAME_PROGRAM (fp);