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: Tue, 21 Feb 2012 17:05:56 +0100 Organization: Organization?!? Message-ID: <87r4xocgt7.fsf@fencepost.gnu.org> References: <8762f09tc1.fsf@fencepost.gnu.org> <87d39819mp.fsf@netris.org> <87vcn0ch49.fsf@fencepost.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1329840388 6525 80.91.229.3 (21 Feb 2012 16:06:28 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 21 Feb 2012 16:06:28 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Feb 21 17:06:27 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 1RzsER-0002yK-Oz for guile-devel@m.gmane.org; Tue, 21 Feb 2012 17:06:23 +0100 Original-Received: from localhost ([::1]:35808 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzsEQ-0001Nt-TZ for guile-devel@m.gmane.org; Tue, 21 Feb 2012 11:06:22 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:35519) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzsEL-0001N1-5s for guile-devel@gnu.org; Tue, 21 Feb 2012 11:06:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RzsEF-0007P1-7z for guile-devel@gnu.org; Tue, 21 Feb 2012 11:06:17 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:48697) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzsEF-0007Os-2M for guile-devel@gnu.org; Tue, 21 Feb 2012 11:06:11 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1RzsEB-0002r3-3p for guile-devel@gnu.org; Tue, 21 Feb 2012 17:06:07 +0100 Original-Received: from p57b9ebd8.dip.t-dialin.net ([87.185.235.216]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 21 Feb 2012 17:06:07 +0100 Original-Received: from dak by p57b9ebd8.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 21 Feb 2012 17:06:07 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 42 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: p57b9ebd8.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:by96SQ90lef0Tgaeug7MM13aYlA= 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:13912 Archived-At: David Kastrup writes: > Mark H Weaver writes: > >> David Kastrup writes: >>> I guess my "real" problem is that I'd like to do call wrapping by writing >>> >>> (lambda ( . x) (fun . x)) >>> >>> instead of having to write >>> >>> (lambda ( . x) (apply fun x)) >>> >>> I assume eval is not supposed to try dealing with dotted lists? >> >> The problem is that (f . (g x y)) is equivalent to (f g x y). >> Therefore, while Scheme could in theory support procedure calls with a >> dotted tail that happened to be an atom, it would do something rather >> different and confusing if the dotted tail was itself a procedure/macro >> call. > > A list in dotted tail position is evaluated via (map ... eval) rather > than (eval ...). I don't see much of a problem with that. > > It works fine for () as one can see: > guile> (+ . ()) > 0 > guile> > > So why not for others? I'll answer this a bit myself. Well, it does work for other lists. Cough, cough. The question is why it doesn't for non-lists. If (f . x) was supposed to be equivalent to (apply f x), then x would need to be evaluated. In (+ . ()), () itself is _not_ being evaluated. So this would be new behavior, and at least different from that of the non-pair (). I'm still not convinced that it would be a bad idea... -- David Kastrup