Re: Casting to Object[]

2013-07-02 Thread Dmitry Groshev
Thank you, works like a charm and makes my code smell better. On Tuesday, July 2, 2013 8:48:14 PM UTC+4, Christophe Grand wrote: > > => (def a (object-array 1)) > #'user/a > => (set! *warn-on-reflection* true) > true > => (aset a 0 nil) > Reflection warning, NO_SOURCE_PATH:1:1 - call to aset can't

Re: Casting to Object[]

2013-07-02 Thread Christophe Grand
=> (def a (object-array 1)) #'user/a => (set! *warn-on-reflection* true) true => (aset a 0 nil) Reflection warning, NO_SOURCE_PATH:1:1 - call to aset can't be resolved. nil => (aset ^objects a 0 nil) nil hth, Christophe On Tue, Jul 2, 2013 at 5:13 PM, Mikera wrote: > I think that is the only

Re: Casting to Object[]

2013-07-02 Thread Mikera
I think that is the only way. The good news is that this is Clojure, so you can easily wrap it in an "object-array-cast" macro On Tuesday, 2 July 2013 15:41:02 UTC+1, Dmitry Groshev wrote: > > Hello all. > > I have a following deftype: > > (deftype NDArray > [^objects data > ^long n

Re: Casting to Object[]

2013-07-02 Thread Jim
On 02/07/13 15:41, Dmitry Groshev wrote: (let [… #^"[Ljava.lang.Object;" data (.data m) …] (aset data idx v that is exactly how you type-hint non-primitive arrays...agreed it's ugly but there is no other way :) Jim -- -- You received this message because you ar