This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-10-20
Channels
- # ai (1)
- # beginners (17)
- # boot (27)
- # cider (2)
- # cljs-dev (64)
- # clojure (131)
- # clojure-austin (13)
- # clojure-dev (15)
- # clojure-dusseldorf (11)
- # clojure-france (45)
- # clojure-russia (19)
- # clojure-spec (66)
- # clojure-uk (22)
- # clojurescript (97)
- # core-logic (7)
- # cursive (5)
- # data-science (1)
- # datomic (92)
- # dirac (49)
- # emacs (1)
- # events (5)
- # funcool (10)
- # hoplon (79)
- # jobs (1)
- # jobs-rus (1)
- # lein-figwheel (1)
- # leiningen (3)
- # om (14)
- # onyx (35)
- # planck (2)
- # proton (1)
- # re-frame (21)
- # reagent (2)
- # ring-swagger (10)
- # spacemacs (10)
- # specter (18)
- # untangled (7)
- # vim (23)
Question about struct
(def identical-to
{:message "does not match"
:optional true
:state true
:validate (fn [state v ref]
(let [prev (get state ref)]
(= prev v)))})
some validators like the one above can be parameterized. Why are these not functions returning the map containing :message
and so on and instead to this, slightly odd, argument passing via grouping in vectors?@martinklepsch you can define identical-to like a function that return a validator map if you want
@niwinz right, I can totally do that, I'm just wondering why it's done in a different way in the library
Like I perceive the validator-args-via-vector thing as more complex than functions but I guess there's a reason for it so I'm curious to understand
ok, cool 👍