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
=> (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
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
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
Hello all.
I have a following deftype:
(deftype NDArray
[^objects data
^long ndims
^longs shape
^longs strides])
(
https://github.com/si14/matrix-api/blob/70b376f58ec3846df6622b971001c3ade32d0725/src/main/clojure/clojure/core/matrix/impl/ndarray.clj#L30
)
Then, when I use "da