Re: About metadat and #^ macro.

2011-10-20 Thread mmwaikar
Thanks everyone for your inputs and the discussion. Manoj. -- 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 fir

Re: About metadat and #^ macro.

2011-10-20 Thread Luc Prefontaine
Hey guys, The "small loss of performance expression" was applied to the specific example I used to illustrate the thing. 500 times longer may look huge but if it occurs 10 times in your application run, bottom line it may mean nothing. Of course if you have a fn chewing up 30% of your application

Re: About metadat and #^ macro.

2011-10-20 Thread Baishampayan Ghose
On Thu, Oct 20, 2011 at 3:53 PM, Chris Perkins wrote: > 1) Make reflection an automatic error (not even a warning), and > 2) Use another syntax (let's say double-dot, for the sake of argument) to > mean "I'm OK with this being done via reflection." > (.foo bar)  => error > (.foo ^SomeType bar) =>

Re: About metadat and #^ macro.

2011-10-20 Thread Chris Perkins
Alan, I'm with you on this one. Reflection is so much slower that sometimes I wish clojure had a different syntax for reflective method invocation. For example: 1) Make reflection an automatic error (not even a warning), and 2) Use another syntax (let's say double-dot, for the sake of argument)

Re: About metadat and #^ macro.

2011-10-19 Thread Alan Malloy
I agree with the general sentiment: add typehints later, and only if you need performance in this particular part of the code. I object to the characterization as a "small loss of performance", though. A reflective method call takes about five hundred times as long as a hinted method call in the fo

Re: About metadat and #^ macro.

2011-10-19 Thread Luc Prefontaine
Just use ^ for type hints. http://clojure.org/java_interop#Java%20Interop-Type%20Hints Type hints are used to eliminate reflection calls, the compiler can use the exact type of the parameter to eliminate the runtime cost of finding if methods/fields exist before calling/accessing them. user=>

Re: About metadat and #^ macro.

2011-10-19 Thread Baishampayan Ghose
Sunil, > I read in "Clojure in Action" book by Amit Rathore, that #^ associates > metadata for the next form. He also mentions that it is deprecated. So what > is the current way of doing it? > > Also, in code like this - > > (defn filenames-in-jar > "Returns a sequence of Strings naming the non-d

Re: About metadat and #^ macro.

2011-10-19 Thread Ben Smith-Mannschott
The current syntax is just ^ (defn filenames-in-jar [^JarFile jar-file] ...) On Thu, Oct 20, 2011 at 07:03, mmwaikar wrote: > Hi, > > I read in "Clojure in Action" book by Amit Rathore, that #^ associates > metadata for the next form. He also mentions that it is deprecated. So what > is the curr

About metadat and #^ macro.

2011-10-19 Thread mmwaikar
Hi, I read in "Clojure in Action" book by Amit Rathore, that #^ associates metadata for the next form. He also mentions that it is deprecated. So what is the current way of doing it? Also, in code like this - (defn filenames-in-jar "Returns a sequence of Strings naming the non-directory entri