Fork me on GitHub
#clojure-spec
<
2019-04-03
>
Alex Miller (Clojure team)01:04:25

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

didibus03:04:49

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.

djtango10:04:19

@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?

djtango10:04:42

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? :)

kenny16:04:37

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

djtango17:04:05

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
djtango09:04:47

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

djtango13:04:07

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

Alex Miller (Clojure team)13:04:56

there is an old ticket for it

djtango13:04:03

đź‘Ť awesome thanks!

mpenet19:04:23

That would be a huge improvement

hadils21:04:55

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))

hadils21:04:18

Is this possible?

hadils21:04:53

Nvm, I answered my own question…