Comment made by: alexmiller
It's not worth bike-shedding names on this - Rich will have his own opinion regardless.
On the patch:
- remove the :static metadata, that's not used anymore
- needs docstrings, which should be written in the style of other Clojure docstrings. map is probably a good place to draw from.
- rather than declare into, defer the definition of these till whatever it needs has been defined. There is no reason to add more declares for this.
There are other potential implementations - these should be implemented and compared for performance across a range of input sizes. In addition to the current approach, I would investigate:
- reduce-kv with construction into a transient map. This allows the map to reduce itself (no seq caching needed) and avoid creating entries only to tear them apart again.
- transducers with (into {} (map ...) m)
Also should consider
- whether to build a k/v vector and convert to a map, or build a map directly (the former may be faster, not sure)
- if building the map, how to construct the map entries (vector vs creating a mapentry object directly)
- in map-keys, is there any open question when map generates new overlapping keys?
- are there places in existing core code where map-keys/map-vals could be used (I am pretty certain there are)