I can’t reproduce any of this on Clojure 1.9.0 Alpha 10 – it all works exactly
as expected.
On 8/9/16, 2:50 PM, "Fluid Dynamics" wrote:
=> (defn foo [x] (doto (double-array 1) (aset 0 x)))
=> [(foo 3.0) (type (foo 3.0))]
[[3.0]
What Clojure version are you using?
On Tuesday, August 9, 2016 at 5:01:21 PM UTC-5, Fluid Dynamics wrote:
>
> => (defn foo [x] (doto (double-array 1) (aset 0 x)))
> => [(foo 3.0) (type (foo 3.0))]
> [[3.0] [D] ; As expected, a double array with the value passed in.
> ; Maybe a good idea to hint
It's impossible to read what you've written here. Can you give us a minimum
failing use case? Thanks.
Timothy
On Tue, Aug 9, 2016 at 3:50 PM, Fluid Dynamics wrote:
> => (defn foo [x] (doto (double-array 1) (aset 0 x)))
> => [(foo 3.0) (type (foo 3.0))]
> [[3.0] [D] ; As
=> (defn foo [x] (doto (double-array 1) (aset 0 x)))
=> [(foo 3.0) (type (foo 3.0))]
[[3.0] [D] ; As expected, a double array with the value passed in.
; Maybe a good idea to hint this function as always returning a double
array.
=> (defn foo ^doubles [x] (doto (double-array 1) (aset 0 x)))