Fork me on GitHub
Alex Miller (Clojure team)01:04:25

spec is based on Clojure maps and is not intended to support Java colls


Ya, I think I was confused, I thought all Java collections were Clojure's, but its the other way around only. And since Java Lists are seqable, anyways. I got around it.


@alexmiller I seem to have some vague memory that you guys were maybe looking at alternatives to generatively testing functions that are argument inputs or map entries, but can't seem to find anything to follow on this subject?


am I remembering correct? This was prompted by some of the discussion @kenny and @gfredericks were talking about

Alex Miller (Clojure team)15:04:16

not sure what you're talking a bout

Alex Miller (Clojure team)15:04:20

can you give me some more hints? :)


I believe he may be referencing the ability to disable generative fspec testing in production.


but am I imagining that there would have been an alternative way to check if the specs were still correct?

Alex Miller (Clojure team)17:04:42

oh, yeah, my current thought on this is to instead of generatively testing the function to wrap the function with something that checks arg specs of the inputs

🙏 4

Ah nice - is any of the ideas/progress on this happening anywhere public?


ha - ok is there a jira on this specific bit?

Alex Miller (Clojure team)13:04:56

there is an old ticket for it


đź‘Ť awesome thanks!


That would be a huge improvement


Q: I want to define a spec some thing like:

(s/def ::firstName string?)
(s/def ::lastName string?)
(s/def ::email utils/email-address?)
(s/def ::type #{:receive-only :personal :business})
(s/def ::businessName string?)
(s/def ::receive-only-user (s/and (s/keys :req-un [::firstName ::lastName ::email ::type]) (::type equals :receive-only))


Is this possible?


Nvm, I answered my own question…