Vinzent <ru.vinz...@gmail.com> writes: > As I've mentioned earlier, '(1 2 3) and [1 2 3] is two different > objects, but it's a single value - collection of numbers 1, 2 and 3, > in this order. This is true for all built-in clojure types of data - > equal things are the same thing.
No, equal doesn't mean they are the same thing. For sequentials like lists and vectors equality is defined as "same length and equal objects in the same order". Nevertheless, that doesn't mean that you can exchange all vectors in your code by equal lists. For example, you cannot call `subvec' on a list. > 'false' is a clojure built-in, false and true are JVM built-ins. > so I'd expect that its behaviour is similar. 'false' is equal to > (Boolean. false); it implies that they represents the same > value. Thus, the same value can be considered as both truthy and > falsey by clojure, which is like blowing my mind. You could argue the same way that since (1 2 3) and [1 2 3] are equal, they represent the same value, and thus you should be able to call `subvec' on both of them. > Of course it's possible to say that one of ='s arguments is a java > class, so you can't rely on it, but it just doesn't feel right for me. Since you are complaining about =, do you mean that = should be special-cased to do an identity-check instead of an equality check for java.lang.Booleans? E.g., are you demanding that (= false (Boolean. false)) should be false? That would be horrible. Bye, Tassilo -- 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