There are many types and flavors of equality, and only handful of symbols.
Symbol '=' in Clojure does not represent yours fundamental = comparison
operator. = in Clojure compares for the actual value ignoring concrete
types of collections and the internal representation of how the items are
stored.
user=> (= [\1 \2] '(\1 \2) (first {\1 \2}) (seq "12"))
true
I has some not so obvious consequences for sure
user=> (assoc {[1 2] :foo} '(1 2) :bar)
{[1 2] :bar}
But it was carefuly designed that way, considering many trade-offs. Nothing
stops you from defining another equality predicate that will suits your
need.
JW
On Sun, Feb 9, 2014 at 4:04 AM, Andy C <[email protected]> wrote:
> I can ensure all of you that it is very uncomfortable for a newcomer with
> a goofy nick to just come in and say things are broke LOL . So at that
> point I have two choices:
>
> 1) as suggested, find another programming language but that would mean
> that I would have to erase my Clojure tattoo (very painful).
> 2) stop making enemies and pretend that seq on sets is cools and neat and
> we really do not need to stick to fundeaments of FP: a=b => f(a) = f(b) in
> critical part of the language. It ain't going to happen either.
>
> Although, the worst part about it all is that my carefully crafted piece
> of software used for controlling nuclear power plants relies on Clojure
> set-s. As we above some part of it is non deterministic as the calculated
> controls paramters depends on the order of adding elements to set .... That
> literally sucks!
>
> In any case, see you at Clojure West conference and thanks again for all
> the replies,
>
> Best regards,
> Andy
>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to [email protected]
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> [email protected]
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.