Skip to content

Instantly share code, notes, and snippets.

Created August 22, 2017 18:21
Show Gist options
  • Save anonymous/a60c40e84d4995f400dab0122432eabe to your computer and use it in GitHub Desktop.
Save anonymous/a60c40e84d4995f400dab0122432eabe to your computer and use it in GitHub Desktop.
show conform bug in spec
(s/def ::test
(s/+ (s/alt :a #{\a}
:b (s/+ (complement #{\a})))))
(s/conform ::test (vec "aba"))
#_> [[:a \a] [:b [\b]] [:a \a]] ; this seems fine
(s/conform ::test (vec "abba"))
#_> [[:a \a] [[:b [\b \b]] [:a \a]]] ; here it seems already weird that :b is double-wrapped
(s/conform ::test (vec "aabba"))
#_> [[:a \a] [[:a \a] [:b [\b \b]] [:a \a]]] ; this can't be right
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment