Re: s/valid? vs. s/explain
Thank you, Alex. Both for the feedback about what I'm doing wrong and for a fix that looks simple and obvious. Regards, James On Sunday, November 13, 2016 at 9:57:55 AM UTC-6, James Gatannah wrote: > > One of my system boundary data structures is particularly ugly. It > involves things like JNI classes wrapping native socket libraries, go > loops, and higher-order functions that I can use to plug in message > dispatchers. > > I'm in the process of translating it from schema to spec. So far, the > process has been very educational. > > I've reached a point where calling (s/valid? ::foo x) returns false, but > (s/explain ::foo x) returns nil. > > Is this a bug in spec? Or am I misinterpreting the docstrings? > > (Narrowing it down enough to identify/fix my actual problem is one thing. > Getting something that's easily/obviously reproducible is going to be more > difficult, just because the problem spans at least 3-4 different github > repos). > > Thanks, > James > > -- 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.
Re: s/valid? vs. s/explain
Ticket filed: http://dev.clojure.org/jira/browse/CLJ-2057 Thanks! On Sun, Nov 13, 2016 at 3:36 PM, Alex Millerwrote: > Any case where valid? returns false and explain-data returns nil is a bug. > > -- > 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 a topic in the Google > Groups "Clojure" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/clojure/1gOBPLk5wpg/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- 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.
s/valid? vs. s/explain
Any case where valid? returns false and explain-data returns nil is a bug. -- 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.
Re: s/valid? vs. s/explain
s/explain doesn't produce any sort of error/output that I can see. s/explain-data returns nil. s/explain-str returns the last few lines printed by the function being exercised. Maybe it captures output from the final test run? On Sun, Nov 13, 2016 at 10:22 AM, Josh Tilleswrote: > Just going on memory at the moment, but I’m pretty sure `s/explain` just > writes to `*out*` (and thus always returns `nil`). You probably want > `s/explain-data` or `s/explain-str`. > > -Josh > > On Sun, Nov 13, 2016 at 10:58 AM James Gatannah > wrote: >> >> One of my system boundary data structures is particularly ugly. It >> involves things like JNI classes wrapping native socket libraries, go loops, >> and higher-order functions that I can use to plug in message dispatchers. >> >> I'm in the process of translating it from schema to spec. So far, the >> process has been very educational. >> >> I've reached a point where calling (s/valid? ::foo x) returns false, but >> (s/explain ::foo x) returns nil. >> >> Is this a bug in spec? Or am I misinterpreting the docstrings? >> >> (Narrowing it down enough to identify/fix my actual problem is one thing. >> Getting something that's easily/obviously reproducible is going to be more >> difficult, just because the problem spans at least 3-4 different github >> repos). >> >> Thanks, >> James >> >> >> -- >> 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. > > -- > 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 a topic in the > Google Groups "Clojure" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/clojure/1gOBPLk5wpg/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- 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.
Re: s/valid? vs. s/explain
Just going on memory at the moment, but I’m pretty sure `s/explain` just writes to `*out*` (and thus always returns `nil`). You probably want `s/explain-data` or `s/explain-str`. -Josh On Sun, Nov 13, 2016 at 10:58 AM James Gatannahwrote: > One of my system boundary data structures is particularly ugly. It > involves things like JNI classes wrapping native socket libraries, go > loops, and higher-order functions that I can use to plug in message > dispatchers. > > I'm in the process of translating it from schema to spec. So far, the > process has been very educational. > > I've reached a point where calling (s/valid? ::foo x) returns false, but > (s/explain ::foo x) returns nil. > > Is this a bug in spec? Or am I misinterpreting the docstrings? > > (Narrowing it down enough to identify/fix my actual problem is one thing. > Getting something that's easily/obviously reproducible is going to be more > difficult, just because the problem spans at least 3-4 different github > repos). > > Thanks, > James > > > -- > 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. > -- 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.
Re: s/valid? vs. s/explain
Turns out I was wrong about the minimal use case. This particular problem was just an fdef that was missing a :ret spec. That seems like a bug in s/explain, but I think it's a tossup whether the bug's in the docstring or the implementation. And I'm not entirely convinced that it's a bug at all. But it's strange enough to seem worth mentioning/explaining. Thanks again, James On Sun, Nov 13, 2016 at 9:57 AM, James Gatannahwrote: > One of my system boundary data structures is particularly ugly. It involves > things like JNI classes wrapping native socket libraries, go loops, and > higher-order functions that I can use to plug in message dispatchers. > > I'm in the process of translating it from schema to spec. So far, the > process has been very educational. > > I've reached a point where calling (s/valid? ::foo x) returns false, but > (s/explain ::foo x) returns nil. > > Is this a bug in spec? Or am I misinterpreting the docstrings? > > (Narrowing it down enough to identify/fix my actual problem is one thing. > Getting something that's easily/obviously reproducible is going to be more > difficult, just because the problem spans at least 3-4 different github > repos). > > Thanks, > James > > > -- > 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 a topic in the > Google Groups "Clojure" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/clojure/1gOBPLk5wpg/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- 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.
s/valid? vs. s/explain
One of my system boundary data structures is particularly ugly. It involves things like JNI classes wrapping native socket libraries, go loops, and higher-order functions that I can use to plug in message dispatchers. I'm in the process of translating it from schema to spec. So far, the process has been very educational. I've reached a point where calling (s/valid? ::foo x) returns false, but (s/explain ::foo x) returns nil. Is this a bug in spec? Or am I misinterpreting the docstrings? (Narrowing it down enough to identify/fix my actual problem is one thing. Getting something that's easily/obviously reproducible is going to be more difficult, just because the problem spans at least 3-4 different github repos). Thanks, James -- 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.