Closed prasant94 closed 10 years ago
(.asVector (matrix [[4 -1 2]]))
is better written as (array [4 -1 2])
is this good?
Looks better!
You should remove the ^AVector
type hints - these might cause a problem if the argument isn't actually an AVector
.
Also can you add a test case that uses Clojure vectors, just to ensure that the averctor-coerce
is working as intended? This stuff is a bit fiddly to get correct, so good to have extra tests.
@Prasant94 did you amend this yet? Would be good to get merged in before GSoC ends!
We'll need a vectorz release for this. I am sending a PR over there.
This can be merged now
Looks good!
I think there should be at least an
avector-coerce
in the protocol implementations? You can't guarantee that the input will always be anAVector
(might be a Clojure vector, for example).Good to have a test or two that check this behaviour.