This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-28
Channels
- # aleph (1)
- # arachne (4)
- # beginners (13)
- # boot (18)
- # clara (7)
- # cljs-dev (156)
- # cljsrn (278)
- # clojure (163)
- # clojure-conj (5)
- # clojure-dev (1)
- # clojure-losangeles (1)
- # clojure-poland (2)
- # clojure-sg (1)
- # clojure-spec (15)
- # clojure-uk (17)
- # clojurescript (275)
- # data-science (5)
- # datomic (23)
- # emacs (10)
- # leiningen (1)
- # lumo (16)
- # off-topic (98)
- # onyx (10)
- # parinfer (83)
- # re-frame (18)
- # reagent (47)
- # remote-jobs (1)
- # ring (1)
- # ring-swagger (5)
- # rum (6)
- # specter (8)
- # vim (5)
@alexmiller is there anywhere to look to find out which core functions are spec'd / will be spec'd?
@bfabry check out https://github.com/jpmonettas/inspectable/ , specially the browse-spec functionality
does anyone know of existing code which produces fully resolved spec descriptions with respect to the namespace from whence they came?
e.g. (spec/describe some-spec) => (clojure.spec.alpha/coll-of foo.bar/bean-sprout?)
not (`(coll-of bean-sprout?)`)
if I understood correctly (spec/form some-spec) is what you are looking for
also check https://github.com/jpmonettas/pretty-spec if you want to pretty print it
@noprompt I did some stuff that does reflection on the specs, I would be interesting to know if you can figure that out. afaik, this can be tricky, because to correctly resolve that you need to know the namespace definitions for the place where the spec was defined (which can be different from the spec namespace itself), so I'm not sure if that is even possible, given that you might not be able to disambiguate the non-qualified names (or even the qualified, considering aliases can change). but anyway, please let me know if you figure it slightly_smiling_face
@noprompt @wilkerlucio but isn't (spec/form ...) just that?
@jpmonettas that returns the original form as data, but it doesn't give you the context about, so imagine that I have a spec like (s/def ::some-spec my-pred?)
, just by reading the form, how can you tell from where my-pred?
comes from?
maybe by getting the var
from the function reference, might be possible there, but then I have no idea on how to do that on CLJS
@wilkerlucio sorry still don't get it, s/form returns everything qualified, I think the idea is you can serialize, deserialize specs
@jpmonettas ha, you are right, hahha, man, I was assuming it didn't because of what noprompt said, but I did the test now and you are right, it returns with the full name 😅
@jpmonettas @wilkerlucio thank you!