Fork me on GitHub
#clojure-spec
<
2019-04-03
>
alexmiller01: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

alexmiller15:04:16

not sure what you're talking a bout

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

alexmiller17: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

djtango09:04:47

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

alexmiller11:04:20

And I write a weekly journal at http://insideclojure.org

djtango13:04:07

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

alexmiller13:04:56

there is an old ticket for it

djtango13:04:03

:+1: awesome thanks!

alexmiller13:04:07

there may be others

mpenet19:04:23

That would be a huge improvement

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

hadilsabbagh1821:04:18

Is this possible?

hadilsabbagh1821:04:53

Nvm, I answered my own question…