Re: Relative merits of Lisp-1 vs. Lisp-2?



Pascal Costanza wrote:

I mostly agree with your assessment. But note that a functional programming
style is somewhat more convenient with a Lisp-1. It's easier to express
things like (((f x) y) z) whereas in a Lisp-2 you would have to say (funcall
(funcall (f x) y) z). So if you have a strong preference for functional
programming (or would like to explore it more deeply) you might want to try
out a Lisp-1 (i.e., Scheme).

Maybe I'm missing something but I don't see what this (I mean the need
for funcall) has to do with being a Lisp-2 at all. Consider

(defun make-adder (n)
(lambda (x) (+ n x)))

((make-adder 10) 3)


I never understood why Common-Lisp doesn't like that. Knowing that this
expression must be a function call, we expect that the evaluation of the first
object in the list, (make-adder 10) returns a function, which it does. In
turn, (make-adder 10) being a function call, we expect that make-adder
evaluates to a function (that's the only place where there is a Lisp-2 thing),
which it does. What's wrong with that ?


--
Didier Verna, didier@xxxxxxxxxxxxx, http://www.lrde.epita.fr/~didier

EPITA / LRDE, 14-16 rue Voltaire Tel.+33 (1) 44 08 01 85
94276 Le Kremlin-Bicêtre, France Fax.+33 (1) 53 14 59 22 didier@xxxxxxxxxx
.



Relevant Pages

  • Re: Relative merits of Lisp-1 vs. Lisp-2?
    ... style is somewhat more convenient with a Lisp-1. ... (funcall (f x) ... programming you might want to ... object in the list, (make-adder 10) returns a function, which it does. ...
    (comp.lang.lisp)
  • Re: Relative merits of Lisp-1 vs. Lisp-2?
    ... programming style is somewhat more convenient with a Lisp-1. ... would have to say (funcall (funcall (f x) y) z). ... it more deeply) you might want to try out a Lisp-1 ... Perhaps it's only that I'm used to lisp-2, ...
    (comp.lang.lisp)
  • Re: Relative merits of Lisp-1 vs. Lisp-2?
    ... programming style is somewhat more convenient with a Lisp-1. ... would have to say (funcall (funcall (f x) y) z). ... it more deeply) you might want to try out a Lisp-1 ... Perhaps it's only that I'm used to lisp-2, ...
    (comp.lang.lisp)
  • Re: Relative merits of Lisp-1 vs. Lisp-2?
    ... style is somewhat more convenient with a Lisp-1. ... (funcall (f x) ... for funcall) has to do with being a Lisp-2 at all. ... object in the list, (make-adder 10) returns a function, which it does. ...
    (comp.lang.lisp)
  • Re: LISP
    ... Lisp-2 over Lisp-1. ... looks like just another ruse to get people to look at Clojure code. ... a language which has only a variable ...
    (comp.lang.lisp)