This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-05-14
Channels
- # architecture (5)
- # beginners (36)
- # boot (3)
- # cider (89)
- # clara (35)
- # cljsrn (6)
- # clojure (123)
- # clojure-dev (15)
- # clojure-italy (9)
- # clojure-nl (14)
- # clojure-spec (11)
- # clojure-uk (192)
- # clojurescript (27)
- # cursive (22)
- # data-science (1)
- # datascript (1)
- # datomic (31)
- # defnpodcast (1)
- # duct (1)
- # emacs (9)
- # fulcro (2)
- # graphql (16)
- # jobs-discuss (10)
- # juxt (1)
- # keechma (7)
- # mount (4)
- # off-topic (83)
- # onyx (8)
- # pedestal (5)
- # portkey (1)
- # re-frame (44)
- # reagent (29)
- # reitit (4)
- # remote-jobs (1)
- # ring-swagger (1)
- # rum (24)
- # shadow-cljs (1)
- # spacemacs (30)
- # tools-deps (6)
- # vim (23)
Bit of a thought bubble but how about using spec's generative features to do "type checking" like behaviour in the IDE: https://gist.github.com/olivergeorge/584b54fe0b1d4c6ce3c7a44ee8c29095
Should be doable at least with cursive I think, it already has a check for having the correct arity.
what’s the best way to get the keys descriptions for a s/keys :req
) form? calling (s/describe)
returns a (keys)
but not sure how can it be used.
got it. managed to do what i wanted this way:
(s/def :clecto/person (s/keys :req [:clecto.person/first-name :clecto.person/last-name]))
(apply hash-map (rest (s/form :clecto/person)))
user> {:req [:clecto.person/first-name :clecto.person/last-name]}
How can i check against a collection that only certain values of maps in the collection are unique? i.e. that the collection of maps is valid iff all maps in the collection have distinct values for at least one of two fields. ex:
[{:unique-field "abc" :a 1 {unique-field2 "abc2"} {:unique-field "abc" :a 3 {unique-field2 "abc2"}]
does not pass validation but
[{:unique-field "abc1" :a 1 {unique-field2 "abc2"} {:unique-field "abc" :a 3 {unique-field2 "abc2"}]
doesso then the spec for that map would include that field and that spec above and would only allow those values