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
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
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) =>
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)
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
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=>
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
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
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