Oh! Sweet : )
On Jun 4, 6:29 pm, "Stephen C. Gilardi" <squee...@mac.com> wrote:
> On Jun 4, 2009, at 5:56 PM, Max Suica wrote:
>
> > But
> > (-> x identity) => (identity x) => x, so what our friend ozzi suggest
> > sounds pretty on the level.
> > If (identity x) is not equivalent to evaluating x, then, well, that's
> > not the identity function :)
>
> You're correct that the result would be the same.
>
> Meikel's point was that if we want to change the macro -> such that (-
> > x) is a legal expression whose value is x, it's slightly better (by
> saving one function call at runtime) for its expansion to be:
>
> x
>
> rather than
>
> (identity x)
>
> (defmacro ->
> "Threads..."
> ([x] x)
> ([x form] (if (seq? form)
> `(~(first form) ~x ~@(next form))
> (list form x)))
> ([x form & more] `(-> (-> ~x ~form) ~...@more)))
>
> --Steve
>
> smime.p7s
> 3KViewDownload
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---