The phrase library can create human-readable error messages:
https://github.com/alexanderkiel/phrase

I've been working on something for a more natural (to me) approach, with 
the ability to define error messages in-line with the predicate. E.g.,

(s/defop max-length [n]
  (sf/validator
   #(>= n (count %))
   (str "Must be " n " characters or less.")))

I got this working with spec-alpha2, but my plan was to write some reforms 
helpers, and I don't think there is any alpha2 support in ClojureScript. It 
seems a lot harder to write specs for the shipping version of spec, but 
I'll probably give it a shot this weekend.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/9111b3ec-8f1c-4bed-8414-6a50527796c2%40googlegroups.com.

Reply via email to