in reply to Re^2: An infix fix
in thread An infix fix

I don't know LISP and even I know the result is 222. The prefix operators are greedy.

Being right, does not endow the right to be rude; politeness costs nothing.
Being unknowing, is not the same as being stupid.
Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

Replies are listed 'Best First'.
(OT) Re^4: An infix fix
by Jenda (Abbot) on Mar 24, 2005 at 14:49 UTC

    It's quite a few years since I did anything with Lisp myself so I do not know whether the + and * was made to accept a variable number of parameters or just two. Suppose you defined a function yourself and it expected two parameters, what would the result of (foo 1 2 3) be then? The same as (foo 1 2) or ((foo 1 2) 3) or even (foo (foo 1 2) 3) or (foo 1 (foo 2 3))?

    Jenda
    We'd like to help you learn to help yourself
    Look around you, all you see are sympathetic eyes
    Stroll around the grounds until you feel at home
       -- P. Simon in Mrs. Robinson

      It depends. I suspect, and this is without study, that Lisp functions are naturally greedy and that the fact you only used two parameters is your problem, not Lisp's. I do remember in Paul Graham's book on Lisp (the few chapters I did read) that the mathematical operators are greedy, so the answer would be 222.

      Being right, does not endow the right to be rude; politeness costs nothing.
      Being unknowing, is not the same as being stupid.
      Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
      Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.