[CLJ-1170] conj-ing x on equal values should produce equal results Created: 23/Feb/13 Updated: 01/Mar/13 Resolved: 01/Mar/13
|Affects Version/s:||Release 1.4|
I've recently have run into a WHAT behavior here is an example:
(= tail (rest (cons head tail))) ; true
;; Types don't really match but close enough I guess
;; Bet then it get's ugly (I would expect them to be equal)
This brings me to a pretty surprising behavior, which is conj-ing
I think conj should either produce equal results or list and vectors with
|Comment by Andy Fingerhut [ 24/Feb/13 10:46 AM ]|
Irakli, it is an explicitly documented feature that conj puts new items in different places for lists (at the beginning) and vectors (at the end). rest is explicitly documented to call seq on its argument. See their doc strings.
I don't know if it is explicitly documented, or just long-standing practice, that vectors and seqs with the the same sequence of values in them are equal. I think that a lot of existing code would break if Clojure changed so those were not equal.