ordered
ordered copied to clipboard
Use private not-found var
Problem: When determining if a key exists in the backing map, we rely on matching the value against :flatland.ordered.map/not-found, which probably won't be in backing map but could. By relying on a derivable value, hard to discover bugs can sneak in.
Potential solutions:
- Leave as-is. Easiest, probably won't break anything.
- Use a more complicated keyword. Further decreases the likelihood of a match.
- Create a gensym within the function. Impossible to derive, but requires creation on every call which is slow.
- Create a private var that holds a stable gensym. Impossible to derive, quite fast.
- Create a private Java Object. Impossible to derive, quite fast, less meaningful than gensym.
Chosen solution: I went with 4, which combines the meaningful information of the original namespaced keyword with a unique gensym symbol.
I'm not the official maintainer. But... I think it would be good if you provided: 1) a problem statement, 2) suggestion of how to solve the problem (+ alternatives), 3) a patch, 4) a test which protects against future regressions of the issue stated in 1).
Sure! The patch is covered by this PR (I don't see anything in this repo or in the meta repo about using a clojure.core patch set up), but I can provide more information as desired.