Kaz Kylheku <kkylheku@gmail.com> wrote:
+---------------
| Rob Warnock <rpw3@rpw3.org> wrote:
| > Vsevolod Dyomkin <vseloved@gmail.com> wrote:
| > +---------------
| >| On funcall: I didn't see, where Duane suggested not to have funcall.
| >| He just described a different to CL approach to treating first
| >| position of a list, possible with Lisp-2 strategy.
| > +---------------
| >
| > Though note that permitting the functional position in CL to be any
| > function-returning expression trivally *allows* one to eliminate the
| > built-in FUNCALL function, to wit:
|
| Which is of no use if the applicator you want is something else,
| like APPLY, or MAPCAR.
|
| (defun lisp-1-func (foo &rest args)
| (apply other-func foo args))
|
| Oops.
+---------------
Non-sequitor. APPLY is here a symbol in the CAR of the form,
so the classic rule for symbols in the functional position
applies [pardon the pun].
Now if you're asking how to *implement* APPLY, well, that's another
question entirely, but one which also has nothing to do with FUNCALL.
One should remember that, in Lisp, APPLY is primitive, not FUNCALL,
and in fact the canonical definition of FUNCALL is simply:
(defun funcall (function &rest args)
(apply function args))
-Rob
-----
Rob Warnock <rpw3@rpw3.org>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607