Closed MichaelBlume closed 9 years ago
Michael, this looks like the kind of subtle issue that an Eastwood linter could check for automatically, but I haven't thought about it too long on how to do it yet. Is the basic recommendation you would make be: 'in an :or, no value should depend upon the values of other keys in the same :or' ?
Yeah, that makes sense, there's actually an issue open against Clojure to make it more strict about this http://dev.clojure.org/jira/browse/CLJ-1613
The fact that one :or-param can predictably refer to another is extremely brittle -- it only works because maps in the code become PersistentArrayMaps and they have a specific seq order relative to the order keys are assoced in. With a different map implementation, or with enough keys to spill over to a PersistentHashMap, this explodes.
http://dev.clojure.org/jira/browse/CLJ-1613