One very important difference is that your original version creates
three variables on-the-fly. It then copies the input into these
variables, just to perform a simple addition. This could have a fairly
severe performance penalty in a inner loop. David's version doesn't
suffer from this. The performance hit is a onetime compile cost, from
there it will run just as fast as prefix notation.

As to the actual macro syntax errors you had, I haven't a clue...

Timothy

On Mon, Sep 26, 2011 at 9:11 AM, ru <soro...@oogis.ru> wrote:
> user=> (defmacro infix [[x f y]] `(~f ~x ~y))
> #'user/infix
> user=> (infix (5 + 4))
> 9
>
> Ok, this is working! But, what's the difference?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>



-- 
“One of the main causes of the fall of the Roman Empire was
that–lacking zero–they had no way to indicate successful termination
of their C programs.”
(Robert Firth)

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to