clojure-dev

Issues: https://clojure.atlassian.net/browse/CLJ | Guide: https://insideclojure.org/2015/05/01/contributing-clojure/
cfleming 2020-09-23T04:59:35.002900Z

What is the reasoning behind IObj only being implemented by the core collection implementation classes rather than the interfaces or the base classes? When working with these classes from Java, it leads to a fair amount of ugliness. Here I have a state variable which is an IPersistentMap. If I want the map without the meta, I have to: ((IPersistentMap) (((IObj) state).withMeta(null))) which is pretty nasty. Not even APersistentMap implements it.

alexmiller 2020-09-23T12:23:36.004700Z

Generally I’d say that means it’s only a property of these particular coll implementations, not all such maps etc

alexmiller 2020-09-23T12:31:27.006600Z

In other words, persistent maps etc don’t necessarily have editable metadata, but some impls do

2020-09-23T14:07:07.007900Z

In practice, it seems that most people who have gone to the trouble of implementing new collection types in Clojure have done the work to implement IObj, too. IEditableCollection is a much more involved one, and not as widely implemented.

alexmiller 2020-09-23T14:29:17.008300Z

yeah, this is about what Clojure requires, not what others provide :)