Fork me on GitHub
#clojure-dev
<
2018-03-28
>
rickmoynihan09:03:26

@seancorfield I think there’s a small bug in the core.cache README example: https://github.com/clojure/core.cache#example-usage This line:

(cache/get C1 :c)
should as far as I can see return nil not 42. I think the if above should be wrapped in a (def C2 ,,,) and that get call changed to (cache/get C2 :c). If you make that change though you should probably also change the C2 further down to be C3.

karlis13:03:04

Interesting I just noticed:

(= (clojure.lang.PersistentHashSet/create [(clojure.lang.PersistentHashSet/create [1])]) (java.util.HashSet. [(java.util.HashSet. [1])]))
false

karlis13:03:44

why is that? looking through the implementation of PersistentHashSet I can't see an obvious reason why two versions of #{#{1}} should not be treated as equal.

Alex Miller (Clojure team)13:03:59

b/c they hash differently

rickmoynihan16:03:17

@seancorfield: n/p 🙂 I see there was patch in JIRA to fix this… but I don’t think what was merged actually fixed it

seancorfield16:03:16

Hmm, which issue was that?

seancorfield16:03:23

Oh yeah, I found it. My fault, the patch was correct but not a broad enough example, so I added more code (and got it wrong!).

rickmoynihan16:03:53

yeah… easily done 🙂

rickmoynihan16:03:26

the examples are duplicated somewhat with a better explanation in the wiki… might it be worth just having one copy of them?

rickmoynihan16:03:58

I understand it’s also useful to have something in the repo/README itself though

seancorfield16:03:47

It would also help if it said cache/lookup instead of cache/get since the latter doesn't actually exist...

seancorfield16:03:46

README fixed. The wiki needs a more thorough going over since it really should show examples based on atom wrappers, not the raw immutable caches.