Fork me on GitHub
#clojure-dev
<
2017-11-16
>
bronsa16:11:30

any particular reason why IPersistentSet has its own get(Object) and doesn't implement ILookup?

Alex Miller (Clojure team)17:11:38

IPersistentSet almost certainly pre-dates ILookup (which was added later)

Alex Miller (Clojure team)17:11:59

is IPersistentSet.get() really the same intent as ILookup.valAt()?

bronsa17:11:31

I'd say so

bronsa17:11:00

this comes from a discussion over #clojure-uk where i was explaining why it doesnt make sense for sets to be IAssociative, but I was quite surprised to find out that they weren't ILookup

bronsa17:11:56

if there's no good semantical reason (and I can't think of one!) for IPS to be an ILookup i'd be tempted to make an enhancement ticket

Alex Miller (Clojure team)17:11:20

adding ILookup to IPersistentSet would be a breaking change for existing (non-core) impls of IPS

Alex Miller (Clojure team)17:11:31

could be added to Set impls though

Alex Miller (Clojure team)17:11:20

that would theoretically make calls to sets of keywords faster?

bronsa17:11:30

I believe so

bronsa17:11:57

hmm, wait, depends on what you're talking about :)

bronsa17:11:12

if you meant because of KeywordLookup, no

bronsa17:11:24

that's only there as an inline cache for record access IIRC

bronsa17:11:34

would avoid being routed through getFrom

bronsa17:11:24

not specific to sets of keywords tho