Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Optional element in sequences #348

Open
jenshweber opened this issue Mar 17, 2016 · 1 comment
Open

Optional element in sequences #348

jenshweber opened this issue Mar 17, 2016 · 1 comment

Comments

@jenshweber
Copy link

Hello,
I am trying to understand the behaviour of the option element in the FancySeq example on the Readme page.
The following throws a validation error:

(s/validate FancySeq ["test" 1 2 3])

Why is this so? I think it should validate fine, since they keyword is optional.
Is this a bug, or do I fail to understand the notion of optionality?
Thanks
Jens

@w01fe
Copy link
Member

w01fe commented Mar 18, 2016

Not a bug, the semantics is that if an optional element is not present, the
sequence must stop there. I.e. in regex it's like (o1 (o2 r_)?)? not o1?
o2? r_

We will try to clarify that in the readme, or if you want to take a crack
at it that would be even better :). Thanks!

On Fri, Mar 18, 2016, 4:56 AM Jens Weber notifications@github.com wrote:

Hello,
I am trying to understand the behaviour of the option element in the
FancySeq example on the Readme page.
The following throws a validation error:

(s/validate FancySeq ["test" 1 2 3])

Why is this so? I think it should validate fine, since they keyword is
optional.
Is this a bug, or do I fail to understand the notion of optionality?
Thanks
Jens


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#348

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants