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 19:05:11 +0100 Message-ID: <8762f0cbag.fsf@fencepost.gnu.org> References: <8762f09tc1.fsf@fencepost.gnu.org> <87d39819mp.fsf@netris.org> <87vcn0ch49.fsf@fencepost.gnu.org> <8762f014ob.fsf@netris.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1329847534 3593 80.91.229.3 (21 Feb 2012 18:05:34 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 21 Feb 2012 18:05:34 +0000 (UTC) Cc: guile-devel@gnu.org To: Mark H Weaver Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Feb 21 19:05:31 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 1Rzu5j-0001V0-KF for guile-devel@m.gmane.org; Tue, 21 Feb 2012 19:05:31 +0100 Original-Received: from localhost ([::1]:33067 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rzu5j-0003Ct-1t for guile-devel@m.gmane.org; Tue, 21 Feb 2012 13:05:31 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:47014) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rzu5Y-000383-JX for guile-devel@gnu.org; Tue, 21 Feb 2012 13:05:27 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rzu5R-0001ji-87 for guile-devel@gnu.org; Tue, 21 Feb 2012 13:05:19 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]:49458) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rzu5R-0001jP-44 for guile-devel@gnu.org; Tue, 21 Feb 2012 13:05:13 -0500 Original-Received: from localhost ([127.0.0.1]:35735 helo=lola) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rzu5Q-00072k-3P; Tue, 21 Feb 2012 13:05:12 -0500 Original-Received: by lola (Postfix, from userid 1000) id 6987C20259A; Tue, 21 Feb 2012 19:05:11 +0100 (CET) In-Reply-To: <8762f014ob.fsf@netris.org> (Mark H. Weaver's message of "Tue, 21 Feb 2012 12:23:32 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.10 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:13915 Archived-At: Mark H Weaver writes: > David Kastrup writes: >> >> A list in dotted tail position is evaluated via (map ... eval) rather >> than (eval ...). I don't see much of a problem with that. > > No, it's worse than that. I think you failed to understand my point, > so let me try again. You propose that (f . x) should be equivalent to > (apply f x). When x is not a pair or (). > Therefore, (f . (g x y)) should also be equivalent to (apply f (g x > y)). But (g x y) is a pair. > To make this more concrete, suppose 'f' is 'vector and 'g' is 'list': > > (vector . (list 1 2)) (list 1 2) is a pair (with the car list and the cdr (1 2)). > If we were to adopt your proposal, users would naturally expect this to > evaluate to #(1 2). However, the evaluator sees (vector list 1 2) and > thus produces a vector of three elements: #(# 1 2). Sure. > In summary, your proposed syntax could only be detected if the dotted > tail happened to be an atom. () is an atom, but it is already treated differently. > 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) Good luck. The context already decides what a valid expression is. Not everything looking like one is treated like one. -- David Kastrup