From: fireblade
Subject: Question re CL need of funcall ?
Date: 
Message-ID: <1153161692.659831.246440@b28g2000cwb.googlegroups.com>
After being exposed to Scheme : through converting SICP code to Common
Lisp
I wonder why CL decided to use funcall .
For example
If fn is an function as argument , like

(defun baz (fn x)
   (funcall fn x))

couldn't compiler insert funcall when it sees fn after opening bracket
so this would be the same as above :

(defun baz (fn x)
   (fn x))

(baz #'1+ 2)

From: Barry Margolin
Subject: Re: Question re CL need of funcall ?
Date: 
Message-ID: <barmar-D01F04.20515517072006@comcast.dca.giganews.com>
In article <························@b28g2000cwb.googlegroups.com>,
 "fireblade" <········@YAHOO.COM> wrote:

> couldn't compiler insert funcall when it sees fn after opening bracket
> so this would be the same as above :

Consider:

(defun baz (list x)
  (list list x))

If it automatically inserted funcall, this would call the wrong function.

MACLisp had an option to do the automatic funcall if the name at the 
beginning of an expression doesn't have a function binding, but AFAIK no 
one ever turned on the option.

-- 
Barry Margolin, ······@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
From: Pascal Costanza
Subject: Re: Question re CL need of funcall ?
Date: 
Message-ID: <4i25unF1rb0hU1@individual.net>
fireblade wrote:
> After being exposed to Scheme : through converting SICP code to Common
> Lisp
> I wonder why CL decided to use funcall .

This is a FAQ. Google for Lisp-1 and Lisp-2.


Pascal

-- 
My website: http://p-cos.net
Closer to MOP & ContextL:
http://common-lisp.net/project/closer/