mikera / core.matrix

core.matrix : Multi-dimensional array programming API for Clojure
Other
701 stars 113 forks source link

`fill` does not preserve type #333

Open ToxicFrog opened 6 years ago

ToxicFrog commented 6 years ago
clojure.core.matrix=> (emap (constantly 0) [[1 2] [3 4]])
[[0 0] [0 0]]
clojure.core.matrix=> (fill [[1 2] [3 4]] 0)
#object[clojure.core.matrix.impl.wrappers.NDWrapper 0x7a8e7c99 "[[0 0] [0 0]]"]

I can get back to a vector by calling matrix on the result, but at that point I'm not sure if it isn't better to just use emap everywhere I would otherwise use fill.