Solussd is absolutely correct, but maybe even more simplistic (or easier to
grasp) explanation would be to use metadata if you don't want the
additional (meta)data to change the equality semantics of the map, for
example:
(def test-desc1 {:number-of-threads 10})
(def test-desc2 ^{:integration true} {:number-of-threads 10})
(def test-desc3 {:number-of-threads 10 :integration true})
(= test-desc1 test-desc2) ;; returns true
(= test-desc1 test-desc2 test-desc3) ;; returns false, because while the
first two vars reference equal values, the third one doesn't
Dňa štvrtok, 29. januára 2015 16:10:34 UTC+1 Jonathon McKitrick napísal(-a):
>
> Is there a rule of thumb or set of use cases when metadata is a more
> elegant solution than simply adding more entries to a map or record?
>
--
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/d/optout.