Fork me on GitHub
#clojure-spec
<
2019-11-20
>
abdullahibra10:11:18

hello everyone

abdullahibra10:11:32

what is the spec for checking file data type ?

vlaaad10:11:39

you mean like that #(instance? java.io.File %)?

đź‘Ť 4
Daouda13:11:01

Hey Folks, I am learning spec and need help to understand the registry parte. They say that it help to avoid name collision, but since we already have namespaces, they aren't enough to avoid that? I don't get to see the real advantage of using :: in spec declaration. Can someone help me to understand please with example will be wonderful

Alex Miller (Clojure team)13:11:47

::keywords are “auto-resolved” to have the current namespace so it’s just a useful tool for succinctly making qualified keywords

Alex Miller (Clojure team)13:11:39

They create the exact same result as using :my.ns/keyword so use that if you prefer!

Alex Miller (Clojure team)14:11:10

You’ll see them in a lot of examples as it just makes the example shorter

Daouda16:11:34

Thank you very much @alexmiller

Daouda17:11:55

I think I`ve got the big picture now. When you want to use a spec/def, first spec look in the spec-registry if exist then take from there. Else it create it and store it in the spec-registry. A very naive description of course hehehe

Daouda19:11:27

Hey Folks, when should I use qualified or unqualified keys in clojure spec?

Alex Miller (Clojure team)19:11:30

unless you are working with existing data, don't want to transform it, and it has unqualified keys

thanks3 4