Hi all,
For the past 2 hours I've been trying to write 'afilter' or 'aremove'
on top of 'areduce' but I'm totally failing...something goes wrong with
the type hints I suspect...I started with the simplest case possible:
(defn aremove [pred ^longs ns]
(areduce ns i ret (long-array
The exception is because (into-array [0 1 -7 2 -1 -3 4 5 -10])
is not an array of longs, use long-array instead.
In the areduce, we also have to return ret after each computation, like so:
(defn aremove [pred ^longs ns]
(areduce ns i ret (long-array (alength ns))
(let [v (aget ns