This recursive definition also works - the difference is that the inner
:html/element is not wrapped in s/spec:
(s/def :html/element
(s/cat
:tag keyword?
:attrs map?
:children (s/* (s/alt :element :html/element
:string string?))))
I'm a bit confused about when recursion works and when it doesn't
On Thursday, 6 October 2016 21:52:07 UTC+3, Aaron wrote:
>
> Well I'm referring to the OP's original example:
>
> (s/def :html/element
>> (s/cat
>> :tag keyword?
>> :attrs map?
>> :children (s/* (s/alt :element (s/spec :html/element)
>> :string string?))))
>>
>> The exception says: "Unable to resolve spec: :html/element".
>>
>
> On Thursday, October 6, 2016 at 7:43:14 AM UTC-4, Alex Miller wrote:
>>
>> Can you share a specific case?
>
>
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/d/optout.