From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: William D Clinger Newsgroups: gmane.emacs.help Subject: Re: Nested Lambda function gives error in common lisp, guile, emacs lisp but works in scheme. Why? Date: Sun, 07 Oct 2007 19:58:15 -0700 Organization: http://groups.google.com Message-ID: <1191812295.692215.113710@57g2000hsv.googlegroups.com> References: <1191735269.656673.146370@50g2000hsm.googlegroups.com> <5mrsliFesppjU1@mid.individual.net> <1191799640.394781.254540@v3g2000hsg.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: sea.gmane.org 1191825589 7886 80.91.229.12 (8 Oct 2007 06:39:49 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 8 Oct 2007 06:39:49 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Oct 08 08:39:47 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IemHL-0007Eo-8C for geh-help-gnu-emacs@m.gmane.org; Mon, 08 Oct 2007 08:39:47 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IemHG-0006pL-8v for geh-help-gnu-emacs@m.gmane.org; Mon, 08 Oct 2007 02:39:42 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!57g2000hsv.googlegroups.com!not-for-mail Original-Newsgroups: comp.lang.lisp,gnu.emacs.help,comp.lang.scheme Original-Lines: 42 Original-NNTP-Posting-Host: 204.94.119.166 Original-X-Trace: posting.google.com 1191812295 9562 127.0.0.1 (8 Oct 2007 02:58:15 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Mon, 8 Oct 2007 02:58:15 +0000 (UTC) In-Reply-To: <1191799640.394781.254540@v3g2000hsg.googlegroups.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: 57g2000hsv.googlegroups.com; posting-host=204.94.119.166; posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0 Original-Xref: shelby.stanford.edu comp.lang.lisp:230583 gnu.emacs.help:152695 comp.lang.scheme:74324 X-Mailman-Approved-At: Mon, 08 Oct 2007 02:38:18 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:48205 Archived-At: David Rush quoting a Common Lisp programmer: > > order to treat a first-class value as a function, you have to shift it > > via FUNCALL. In order to yield a function as a first-class value, you > > have look it up with FUNCTION. > > Makes it sound like there are two fundamentally different *types* of > values And FUNCALL and FUNCTION are the type cast operators between > those types. Is this a valid way of looking at this? No, but that invalid way of looking at it may be common among Common Lisp programmers. What's really going on is that Common Lisp, as a Lisp-2, needs some way to distinguish the environment in which variables are to be resolved. That's the purpose of FUNCTION. Then, to avoid the syntactic clutter of using FUNCTION in the operator expression of almost every call, Common Lisp evaluates operator expressions differently from operand expressions. If you can regard higher-order functions as unnatural, then you can regard Common Lisp's semantics as natural. That's the real lesson of the Gabriel/Pitman paper cited earlier in this thread. By the way, that paper was not subject to normal peer review; it was political from the start, and its conclusion that the advantages and disadvantages of Lisp-1 and Lisp-2 are comparable was pre-ordained. To reach that conclusion, they had to count at least one of the arguments against Lisp-2 as an argument in favor of Lisp-2. I won't spoil your fun by explaining this; it's obvious if you read the paper carefully with an open mind. Will