Eliminate PersistentVector's implementations usage from default.clj
This is a long-term goal, but I think generally it's better to do this.
For now we reuse PersistentVector's implementations in many places in default.clj, coercing a value to persistent vector, performing an operation and coercing it back. This causes slowness (like in 57146955) and bugs (like in #51). We can avoid this in 2 ways:
- use NDArray instead of vectors, as it is presumably faster;
- implement defaults using mandatory protocols on arguments.
This options does not contradict with each other, so we can use them both.
Agree in general, NDArray should be able to replace persistent vector usage. In particular, it actually allows the mutable operations to be implemented properly :-)
There might be a few cases where persistent vectors are more efficient - I think we can use them on a case-by-case basis however.