-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Description
Problem/Opportunity
We just merged #419 which perserves sexpr map element order for small maps (just like Clojure happens to do).
But maybe we could always (or optionally) preserve sexpr maps regardless of map size.
Option 0: Don't do anything
We are good with #419 behaviour.
Pros:
- no new code, no new bugs!
Cons:
sexprmap order is preserved only for small maps
Option 1: Always preserve map order
Pros:
- No additional knobs or dials to turn
Cons:
- This is a perf impact for larger maps with no way to opt out
Option 2: Add an option flag
Add an option to preserve sexpr map element order.
Maybe :preserve-map-elem-order?
Pros:
- There is a performance impact for larger maps, this would let the user choose.
Cons:
- Granularity of choice is not tweakable at map level.
Option 3: Add an option fn
Add an option to specify a map fn
Maybe :sexpr-map-fn.
Pros:
- User can tweak choice at map level
Cons:
- More complicated to use than a flag.
Additional Notes
- default behaviour would remain unchanged
- option would be available at node sexpr level fns and zipper creation fns.
- this does not cover preserving order of sets, we are just talking about maps here.
Next Steps
Mull over choices, flesh out details.
If we were to proceed, I think Option 3 might be interesting to explore.
Metadata
Metadata
Assignees
Labels
No labels