Closed andrioni closed 9 years ago
Ouch. This is a consequence of changing how Specter handles keywords. Your path undoes the worst of it, but there's still the problem that Structural-Typing changes the way Specter works. The only change is handling of a nonsensical case. Specter is like Clojure:
user=> (get 1 :a)
nil
user=> (s/select [:a] 1)
[nil]
But I changed the handling of keywords to throw an error:
user=> (s/select [:a] 1)
Exception 1 is not a map sun.reflect.NativeConstructorAccessorImpl.newInstance0 (NativeConstructorAccessorImpl.java:-2)
That's better behavior, I think, but changing the way some other library works is just wrong.
Hi!
I'm having this weird interaction between structural-typing and specter, which makes specter stop working for some transformations after I require structural-typing, even in the repl.
Sample (running
lein repl
at the root of structural-typing):From what I can tell, apparently it comes from structural-typing.guts.compile.to-specter-path, but my knowledge of Clojure is not good enough to understand what's happening.