The Joy of Clojure book touches on this, it is an important design and style decision. Great book, good question too. I'm learning about all this stuff right now and it is all good stuff.
On Wed, Oct 3, 2012 at 3:44 AM, Mark Engelberg <mark.engelb...@gmail.com> wrote: > It is surprising at first, but since vectors are used so commonly in Clojure > instead of lists to represent literal sequential collections of data, it > turns out to be extremely convenient to be able to compare it for equality > against sequential collections generated as lists or lazy sequences. > Basically, all those things are just flat, linear collections, and what we > really care about from an equality standpoint is whether the collections > have the same elements in the same order. Clojure similarly considers > different types of maps (hash-maps, array-maps, sorted-maps) to be equal if > the associations are the same. Ditto for hash-sets and sorted-sets. > > > On Tue, Oct 2, 2012 at 10:24 PM, Larry Travis <tra...@cs.wisc.edu> wrote: >> >> What is the rationale for this? >> >> user> (= [1 2 3 4] '(1 2 3 4)) >> true >> >> I was quite surprised when this turned out to be the cause of a bug in a >> function I am constructing. Vectors and lists differ so substantially in >> their implementation and in their behavior that a vector and a list should >> not be considered "equal" just because they contain the same elements in the >> same order. >> >> --Larry >> >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Clojure" group. >> To post to this group, send email to clojure@googlegroups.com >> Note that posts from new members are moderated - please be patient with >> your first post. >> To unsubscribe from this group, send email to >> clojure+unsubscr...@googlegroups.com >> For more options, visit this group at >> http://groups.google.com/group/clojure?hl=en > > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with your > first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en -- ((λ (x) (x x)) (λ (x) (x x))) http://www.wisdomandwonder.com/ ACM, AMA, COG, IEEE -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en