Re: How to properly spec this simple structure

2017-10-06 Thread Alex Bezhan
Yeah, thanks for noticing, Peter. -- 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

Re: How to properly spec this simple structure

2017-10-05 Thread Peter Hull
I will just point out that, in the suggested answer, (gen/return (make-channel)) calls make-channel once, and creates a generator whose output is that same object repeatedly, not a new instance of the class each time. That may not matter, but it's not what (I think) you intended in your

Re: How to properly spec this simple structure

2017-10-05 Thread Alex Bezhan
https://stackoverflow.com/questions/46592767/how-do-i-make-custom-clojure-spec-generator/46594611#46594611 -- 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

Re: How to properly spec this simple structure

2017-10-05 Thread Alex Bezhan
Here is my question on SO. I got the answer. The issue was that I had some garbage code for REPL, that was not commented out and it was producing the error. Sorry for that, I'm just new to Clojure and trying to learn this stuff. -- You received this message because you are subscribed to the

Re: How to properly spec this simple structure

2017-10-05 Thread Peter Hull
On Thursday, 5 October 2017 20:52:10 UTC+1, Alex Bezhan wrote: > > Can someone explain what I've done wrong and how to do it the right way? As I understand it, you will need to code the generator equivalent of (repeatedly make-channel) but I don't know how to do that, sorry. Then I think you

Re: How to properly spec this simple structure

2017-10-05 Thread Alex Bezhan
Can someone explain what I've done wrong and how to do it the right way? -- 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

Re: How to properly spec this simple structure

2017-10-05 Thread Alex Bezhan
As to how I wrote the channel-gen generator. It's basically what I could write using some examples and I'm pretty sure it's almost incorrect in the sense that it works inefficiently. I'm new to Clojure, so trying to spec things is super hard for me. -- You received this message because you

Re: How to properly spec this simple structure

2017-10-05 Thread Alex Bezhan
Yep, it was my mistake to put channel-type in a parenthesis. I removed that but it still fails with the same error. -- 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

Re: How to properly spec this simple structure

2017-10-05 Thread Alex Miller
On Thursday, October 5, 2017 at 1:52:47 PM UTC-5, Alex Bezhan wrote: > > > > down votefavorite > > > I'm trying to spec the following data structure called Connection: > > {:id "some string" :channel

Re: How to properly spec this simple structure

2017-10-05 Thread Peter Hull
On Thursday, 5 October 2017 19:52:47 UTC+1, Alex Bezhan wrote: > > > > (s/def ::channel (s/spec (::channel-type) > :gen channel-gen)) > > Don't think it's the answer, but should ::channel-type be in parens here? -- You received this message because you are subscribed to