2 ms·
Nice to hear, not CL tho ;P The (equal '(1 2) '(1 2.0)) is really a tricky one. Clojure also fails the (= 1 1.0) test. But I'm really not sure if that's a bad
by j-pb 7y ago
Nice to hear, not CL tho ;P
The (equal '(1 2) '(1 2.0)) is really a tricky one.
Clojure also fails the (= 1 1.0) test. But I'm really not sure if that's a bad thing. I mean (= [1] #{1}) (an ordered vector and an unordered set) is also false, so it kinda makes sense to argue that distinct types are always distinct.
However in clojure (= '(1) [1]) which I find a lot harder to defend It's caused by an automatic conversion to sequences which are then compared, and I think I might even add that one to the "warts" list.