Me:
> No
Well, actually Ambrose of core.typed has proposed an interface to let the
compiler know about type information.
That seems to make it conceivable to mark functions as pure, hence,
implement the optimization you proposed, Jim.
Sorry if my first response sounded a tad negative, btw
A
>Hi Thanks for the super fast response, Still a little confused. If coll is
set to nil before >reduce is called, then what is reduce called with?
Remember, the JVM is a stack machine (before the JIT is run). So the code
produced is something like this:
push coll
push nil
pop-into coll
call-fn red
Hi Thanks for the super fast response, Still a little confused. If coll is
set to nil before reduce is called, then what is reduce called with?
On Tuesday, February 5, 2013 3:21:14 PM UTC, Herwig Hochleitner wrote:
>
> Clojure has a feature called locals clearing, which sets 'coll to nil
> befor
Couldn't the compiler infer that the 2 expressions are identical with
identical arguments and perform the reduce only once? Basically what the
programmer would do in a let statement? Would that be too expensive?
Jim
On 05/02/13 15:21, Herwig Hochleitner wrote:
Clojure has a feature called lo
Clojure has a feature called locals clearing, which sets 'coll to nil
before calling reduce in test1, because the compiler can prove it won't be
used afterwards.
In test2, coll has to be retained, because reduce is called a second time
on it.
2013/2/5 N8Dawgrr
> If the head is retained on a laz