The path is the series of tags you've traversed through the spec (when 
there are parts in :or :alt :cat etc).

We will have more documentation on it but we've held off because it was 
changing pretty regularly in early alphas.

A spec for the current explain-data is something like this (I'm just typing 
this in, so could be a bit off):

;; path is a stack of parts, which refer to tags in schemas
(s/def ::part simple-keyword?)
(s/def ::path (s/coll-of ::part :kind vector?))

;; pred is a symbol, a set, or a function, but being lazy here
(s/def ::pred any?)

;; the failing data value
(s/def ::val any?)

;; via is a stack or schema identifiers
(s/def ::schema-key qualified-ident?)
(s/def ::via (s/coll-of ::schema-key :kind vector?))

;; in is a stack of keys in nested data
(s/def ::data-key any?)
(s/def ::in (s/coll-of ::data-key :kind vector?))

;; some of these may be required, I would have to analyze the code further
(s/def ::problem
  (s/keys :opt-un [::path ::pred ::val ::via ::in]))
(s/def ::problems
  (s/coll-of ::problem :min-count 1))

;; added when macroexpand args check fails
(s/def ::args
  (s/coll-of any?))

(s/def ::explain-data
  (s/keys :req [::problems] :opt [::args]))



On Tuesday, August 23, 2016 at 2:33:34 PM UTC-5, puzzler wrote:
>
> On Tue, Aug 23, 2016 at 7:45 AM, Alex Miller <a...@puredanger.com> wrote:
>
>> We expect Clojure users to become familiar with spec and its output as it 
>> is (now) an essential part of the language. You will see specs in error 
>> messages. 
>>
>
> Is there any documentation to help users understand how to interpret the 
> error messages?  For example, what is the "path" returned by spec errors?  
> I've been through the spec guide, and don't recall seeing anything like 
> that. I've been able to make a few deductions on my own, but without a 
> better mental model, the messages are still pretty mystifying to me.
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to