MyType cannot be cast to MyType?

2014-01-19 Thread Jonathan Barnard
For fun, I've been porting a very simple particle animation from Java to Clojure. It was somewhat slow so to see how fast I could make it I decided to try using mutation. I've defined a Particle type, and a PSlice type that contains an array of objects and a length (number of non-nil objects in

Re: MyType cannot be cast to MyType?

2014-01-22 Thread Jonathan Barnard
user.Foo cannot be cast to user.Foo > > The object `*a-foo*` is an instance of the **first** definition of the > type Foo, which was overwritten by the **second** definition of the type > Foo. > > This problem is caused by a combination of Clojure's runtime generation of >

Re: MyType cannot be cast to MyType?

2014-01-23 Thread Jonathan Barnard
Excellent, that looks quite useful, thank you. On Thursday, 23 January 2014 01:59:21 UTC+11, Mauricio Aldazosa wrote: > > Take a look at Stuart's tools.namespace ( > https://github.com/clojure/tools.namespace), although be wary of the > protocol issue as it is something that is pointed out in the

Why is Clojure faster than Java at this task?

2014-02-25 Thread Jonathan Barnard
I recently did a benchmark (admittedly in hindsight not a particularly good one) that involved comparison of an implementation of the same small program in Javaand in Clojure

Re: Why is Clojure faster than Java at this task?

2014-02-25 Thread Jonathan Barnard
t; optimisation - > http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/math/BigInteger.java#BigInteger.add%28java.math.BigInteger%29) > > > if the overhead of BigInteger is actually needed. > > If you use clojure.lang.BigInt in your Java code, I suspect J