From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.lisp.guile.devel Subject: Re: when and unless Date: Wed, 07 Dec 2011 10:23:25 +0100 Organization: Organization?!? Message-ID: <87liqoivle.fsf@fencepost.gnu.org> References: <878vsjd2fh.fsf@pobox.com> <87r50ircng.fsf@pobox.com> <4EDDC8B1.3000509@gentoo.org> <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> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1323249834 24076 80.91.229.12 (7 Dec 2011 09:23:54 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 7 Dec 2011 09:23:54 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Dec 07 10:23:50 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 1RYDjC-00009P-KW for guile-devel@m.gmane.org; Wed, 07 Dec 2011 10:23:50 +0100 Original-Received: from localhost ([::1]:55413 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RYDjC-000250-2e for guile-devel@m.gmane.org; Wed, 07 Dec 2011 04:23:50 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:55417) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RYDj8-00021f-KJ for guile-devel@gnu.org; Wed, 07 Dec 2011 04:23:47 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RYDj4-0005Rm-8E for guile-devel@gnu.org; Wed, 07 Dec 2011 04:23:46 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:60000) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RYDj3-0005Rd-Pt for guile-devel@gnu.org; Wed, 07 Dec 2011 04:23:42 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RYDj1-00005X-TM for guile-devel@gnu.org; Wed, 07 Dec 2011 10:23:39 +0100 Original-Received: from p508eaf98.dip.t-dialin.net ([80.142.175.152]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 07 Dec 2011 10:23:39 +0100 Original-Received: from dak by p508eaf98.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 07 Dec 2011 10:23:39 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 59 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: p508eaf98.dip.t-dialin.net X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux) Cancel-Lock: sha1:sarJt0DaxxBvB7yoQWdFs1j9y8c= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 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:13000 Archived-At: "Chris K. Jester-Young" writes: > On Tue, Dec 06, 2011 at 11:08:08PM +0100, David Kastrup wrote: >> > Have you considered using `(values)' as your way of saying, "I'm not >> > returning any values"? >> >> Testing for that is not all that much fun. It is also rather useless >> since pretty much all of the call-for-effect functions of Guile return >> *unspecified* rather than (values). > > You're not really supposed to test for it. Lilypond is not Scheme but has a more complex syntax. You can use Scheme in a lot of places with different implications on the grammar depending on the type of the expression. It would not be feasible to create a separate Scheme calling operator for every possible type of expression. And "called just for action" is one such type. >> It is not clear to me why (values) can't just evaluate to a single >> *unspecified* just like '() evaluates to null. Outside of >> call-with-values, I don't see much need to treat it special. > > Implementing that would pretty much either require CPS transforms all > around (then you'd look at the arity of the continuation), or else > you'd have to be keeping track of the arity of the current > continuation some other way. Is it just me, or does that smell like > Perl's wantarray? Well, you'd need to have (call-with-values (lambda () *unspecified*) (lambda x (length x))) => 0 That's the actual clincher I presume? If one takes a look at the Scheme language definition, one finds for one thing: (define (values . things) (call-with-current-continuation (lambda (cont) (apply cont things)))) And, more importantly: Except for continuations created by the call-with-values procedure, all continuations take exactly one value. That means that one _only_ needs to consider the implications on call-with-values continuations. And it is not like Guile has a problem distinguishing content and package itself (at least Guile 1.8): guile> (write *unspecified*) #guile> (write (values)) #guile> So I still don't quite see the problem that would arise from making (eq? *unspecified* (values)) => #t -- David Kastrup