Talking about equality of: user=> (= [1, 2] '(1, 2)) true I also wondered if there could be something as "strict equal", which returns true only if both the operands are equal and of the same type. See JavaScript: http://www.devguru.com/Technologies/ecmascript/quickref/comparison_operators.html http://www.devguru.com/Technologies/ecmascript/quickref/javascript_index.html
Frantisek On Jan 28, 9:17 pm, Cosmin Stejerean <cstejer...@gmail.com> wrote: > On Wed, Jan 28, 2009 at 11:13 AM, Frantisek Sodomka <fsodo...@gmail.com>wrote: > > [...] > > Since this is correct: > > > user=> (= () []) > > true > > > Shouldn't these be also 'true'? > > user=> (= {} []) > > false > > user=> (= {} #{}) > > false > > user=> (= {} ()) > > false > > user=> (= #{} []) > > false > > user=> (= #{} ()) > > false > > Well, I'm not yet sure if I like it but lists and vectors that have > identical elements in them appear to be equal, not just empty ones. > > user=> (= [1, 2] '(1, 2)) > true > > Since any list can be represented as an equivalent vector (and any vector as > an equivalent list) I can imagine this making sense. > > user=> (apply list [1 2 1]) > (1 2 1) > user=> (apply vector '(1 2 1)) > [1 2 1] > > But I don't see how this would ever apply to sets or maps so I don't see why > empty sets and maps should be an exception. > > -- > Cosmin Stejereanhttp://offbytwo.com --~--~---------~--~----~------------~-------~--~----~ 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 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 -~----------~----~----~----~------~----~------~--~---