dsg said: This is my first attempt at submitting a real patch to Clojure, so I appreciate any feedback. This patch actually does a few different things, specifically:
1. Add java.lang.Comparable interface for Vec.
2. Modify vector-of to be a little more user-friendly. The original only creates empty Vecs. My patch allows vector-of to take arguments similar to vector and vec. Importantly, it also takes a primitive array as an argument. The implementation may not be the most efficient, but it seems to work.
3. I added a bunch of tests to ensure that vector-of mirrors the behaviour of standard vectors. In doing so, I ran into a few bugs that led me to implement the Associative interface for Vec and IPersistentCollection to VecSeq.
It is still probably a good idea to add more tests.
Converted from http://www.assembla.com/spaces/clojure/tickets/266
Attachments:
fix266.patch - https://www.assembla.com/spaces/clojure/documents/aUPsnCrXyr36i1eJe5avMc/download/aUPsnCrXyr36i1eJe5avMc
add_comparable_support_to_vec.patch - https://www.assembla.com/spaces/clojure/documents/bt20JetxCr36GpeJe5d-aX/download/bt20JetxCr36GpeJe5d-aX
add_comparable_support_to_vec-revised.patch - https://www.assembla.com/spaces/clojure/documents/c2n-HUtXWr34oReJe5dVir/download/c2n-HUtXWr34oReJe5dVir
eliminate-reflection-in-266.patch - https://www.assembla.com/spaces/clojure/documents/d_AO6it8Sr37m4eJe5dVir/download/d_AO6it8Sr37m4eJe5dVir