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
no one stops you to do so 😄
@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
Is just a cosmetic feature, that makes reading the scheme more uniform
But is just a preference, nothing more
there are no good rationale for this
ok, cool 👍
🙂