4 ms·
user=> (doc vector?) ------------------------- clojure.core/vector? ([x]) Return true if x implements IPersistentVector nil So `MapEntry`
by eddieplan9 12y ago
user=> (doc vector?)
-------------------------
clojure.core/vector?
([x])
Return true if x implements IPersistentVector
nil
So `MapEntry` implements `IPersistentVector`, but is not a vector. It does not make sense to have an empty `MapEntry`, so IMHO the behavior implemented is valid.
- Anderkent 12y ago'Hey, if I peek under the abstraction, it all makes sense'. Obviously. The code does what it's written to do. That doesn't make such leaky abstractions okay. `vector?` is, AFAIK, the way to check if something is a vector, and if empty doesn't work on some `vector?`s, then i can't trust it. empty mapentry returning nil is meh. If it returned an empty vector it'd be what you want 99% of the time.