Re: Why :inline have to define the function twice?

2012-07-16 Thread Aaron Cohen
My guess: to allow functions with :inline metadata to still be used as higher order (first class) functions. Note, the fn specified by :inline is more of a macro than a function, it's called at compile time. How would the following work without a function body? (map pos? [-1 0 1]) definline

Re: Why :inline have to define the function twice?

2012-07-16 Thread dennis zhuang
Yes, thank you for your reply,i total agree with you about why we need :inline form in meta map. But my problem is that why clojure compiler could not use the body form as the :inline value automatically for us instead of writing a duplicate form? I think below codes is more suitable: (defn pos?

Re: Why :inline have to define the function twice?

2012-07-16 Thread Aaron Cohen
On Mon, Jul 16, 2012 at 11:26 AM, dennis zhuang killme2...@gmail.com wrote: Yes, thank you for your reply,i total agree with you about why we need :inline form in meta map. But my problem is that why clojure compiler could not use the body form as the :inline value automatically for us

Re: Why :inline have to define the function twice?

2012-07-16 Thread Timothy Baldridge
But my problem is that why clojure compiler could not use the body form as the :inline value automatically for us instead of writing a duplicate form? I think below codes is more suitable: It's not a duplicate form. Sure it may appear to be to those of us with organic brains that excel at

Re: Why :inline have to define the function twice?

2012-07-16 Thread dennis zhuang
Thanks. Yeath,i know the defline macro,and it is the best way to define inline function.I got your point,thanks. 2012/7/17 Aaron Cohen aa...@assonance.org On Mon, Jul 16, 2012 at 11:26 AM, dennis zhuang killme2...@gmail.com wrote: Yes, thank you for your reply,i total agree with you about