Fork me on GitHub
#clojure-spec
<
2019-04-16
>
borkdude14:04:31

can macro spec checking (for core macros) be disabled from the REPL instead of with a Java property?

Alex Miller (Clojure team)14:04:40

not currently. such a thing could be done by just setting the clojure.lang.RT/CHECK_SPECS flag, but that's not public currently

jumar16:04:50

Is there any reason why the clojure.spec.skip-macros isn't re-loaded dynamically in Compiler every time it's needed? Performance?

Alex Miller (Clojure team)16:04:25

Didn’t seem necessary

👍 4
Alex Miller (Clojure team)14:04:02

you could remove those specs from the registry

Alex Miller (Clojure team)14:04:21

s/def with nil will remove

borkdude14:04:19

I tried (clojure.spec.alpha/def clojure.core/for nil) already, but that didn’t do it

borkdude14:04:49

oh it does work, sorry

borkdude14:04:59

I was testing if for supported beginning with a let but it doesn’t 🙂

(for [:let [x 1] y (range x)] y)

borkdude14:04:27

and I wanted to make sure I wasn’t getting an error from the spec. thanks

hiredman21:04:11

I dunno if nit picking on spec-alpha2 is useful feedback yet, but https://github.com/clojure/spec-alpha2/blob/master/src/main/clojure/clojure/spec_alpha2.clj#L51-L54 is checking if an object implements the interface behind the Schema protocol instead of checking for satisfying the Schema protocol (the namespace imports the interface behind the Spec and the Schema protocols, but is careful to use the Spec protocol everywhere and not the interface)

Alex Miller (Clojure team)21:04:34

Yeah, that’s actually intentional for perf, same in spec 1

hiredman21:04:17

ah, I see, I missed the use of the interface there. and it looks like spec? will return true if you implement the interface, or if you have metadata with the conform* function(satisfy the protocol via metadata), but will return false if you extend the protocol to some type, which seems idiosyncratic

hiredman21:04:31

I guess I'll stay tuned

Alex Miller (Clojure team)22:04:56

In any case, I’m aware :)