redplanetlabs / specter

Clojure(Script)'s missing piece
Apache License 2.0
2.52k stars 102 forks source link

Metadata preservation #237

Open nathanmarz opened 6 years ago

nathanmarz commented 6 years ago

Many Specter navigators do not preserve metadata on transforms, such as ALL, MAP-VALS, and MAP-KEYS. Should look into the performance cost of metadata preservation and whether it's worth updating all the navigators to do so. Implementing this would also eliminate the need for ALL-WITH-META, though it could be kept around for backwards compatibility as (def ALL-WITH-META ALL).

gdeer81 commented 6 years ago

I know performance was always a requirement with this library so I'm not surprised to see an "opt-in" for something that might have a performance cost like ALL-WITH-META versus other libraries and languages that have an "opt-in" for things that have performance benefits like type hinting, hand rolled in-lining, parallel versions of functions, etc

So I imagine if you wanted to go down that road you could provide an ALL-WITHOUT-META for those that are paranoid that hanging on to the metadata is costing nano-seconds.

Like I said, I'm aware that this library's promise has always been performance by default so I imagine you've already thought of this and rejected it.