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: Dotted pair call argument Date: Wed, 22 Feb 2012 10:06:28 +0100 Organization: Organization?!? Message-ID: <87pqd79qzv.fsf@fencepost.gnu.org> References: <8762f09tc1.fsf@fencepost.gnu.org> <87d39819mp.fsf@netris.org> <87vcn0ch49.fsf@fencepost.gnu.org> <8762f014ob.fsf@netris.org> <8762f0cbag.fsf@fencepost.gnu.org> <87sji3zoky.fsf@netris.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1329901606 15945 80.91.229.3 (22 Feb 2012 09:06:46 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 22 Feb 2012 09:06:46 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Feb 22 10:06:46 2012 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1S089t-0003dd-Sg for guile-devel@m.gmane.org; Wed, 22 Feb 2012 10:06:46 +0100 Original-Received: from localhost ([::1]:56962 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S089t-0001be-AX for guile-devel@m.gmane.org; Wed, 22 Feb 2012 04:06:45 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:38958) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S089n-0001bY-EX for guile-devel@gnu.org; Wed, 22 Feb 2012 04:06:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S089m-0000In-7i for guile-devel@gnu.org; Wed, 22 Feb 2012 04:06:39 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:56655) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S089m-0000Ii-1F for guile-devel@gnu.org; Wed, 22 Feb 2012 04:06:38 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1S089l-0003Wa-Ct for guile-devel@gnu.org; Wed, 22 Feb 2012 10:06:37 +0100 Original-Received: from p57b9eb4a.dip.t-dialin.net ([87.185.235.74]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 22 Feb 2012 10:06:37 +0100 Original-Received: from dak by p57b9eb4a.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 22 Feb 2012 10:06:37 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 57 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: p57b9eb4a.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.92 (gnu/linux) Cancel-Lock: sha1:/9brov4DYHdpRyDPARDhVNlOaNE= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:13923 Archived-At: Mark H Weaver writes: > David Kastrup writes: > >>> Scheme has a very useful property which your proposed syntax would >>> destroy: any valid expression can be substituted for any other valid >>> expression, and the result has the same meaning except for the >>> substitution. >> >> guile> (display . (close (current-output-port))) >> #guile> >> >> Now try >> >> (define x (close (current-output-port))) >> (display . x) > > Admittedly I could have been more clear, but I certainly didn't mean to > imply that anything that _looks_ like a valid expression can be > replaced. That would be absurd. Exactly. > What I meant is that any _subexpression_ can be replaced with any other > valid expression, without changing the meaning of the program in any > other way. So the solution would be to not call dotted pair endings of argument lists a "subexpression", and everybody will be happy. > Whether something is a subexpression depends on its _position_ within > the larger expression. Yes. That's the point. The dotted list end is a specific position. Not "subexpression" position. If a list is there, it is evaluated element by element. If a non-list is there, we get an error. Instead, I prefer evaluating it and using the evaluated result, whatever it may be, as the argument list tail. Personally, I would not even demand actual argument lists to be proper lists as long as the declared argument list is a dotted list as well: you can still match arguments then. > The only advantage I see to this proposed syntax is that in some > restricted cases it is more aesthetically pleasing. apply can't handle improper lists either. > I suspect that most experienced Schemers have at some point wondered > why dotted-tail notation is not allowed in procedure calls. I > certainly have, but upon further consideration I became convinced that > the pitfalls of adopting such an ambiguous and potentially confusing > syntax far outweigh the advantages. Nothing that is currently valid would change its meaning. -- David Kastrup