Re: [ANN] Clojure 1.9.0-alpha1

2016-05-26 Thread Sean Corfield
On 5/26/16, 1:43 AM, "Glen Mailer" wrote: >Is the plan that any lib which adds specs will force the rest of the running >system up to 1.9, or is it possible to keep the specs in a different namespace >and not blow up? I would expect

Re: [ANN] Clojure 1.9.0-alpha1

2016-05-26 Thread Mike Rodriguez
Thanks for this explanation. I think that cleared up some of this for me more. I'm certainly excited about this new addition. I should have started off with that. On Wednesday, May 25, 2016 at 8:01:49 PM UTC-5, Rich Hickey wrote: > > I’d advise everyone concerned/confused about the

Re: [ANN] Clojure 1.9.0-alpha1

2016-05-26 Thread Glen Mailer
Is the plan that any lib which adds specs will force the rest of the running system up to 1.9, or is it possible to keep the specs in a different namespace and not blow up? Would it be reasonable to release something for 1.8 which contains all the spec vars but no-ops them? -- You received

Re: [ANN] Clojure 1.9.0-alpha1

2016-05-25 Thread Rich Hickey
I’d advise everyone concerned/confused about the relationship between spec and data representations to please spend some more time trying to understand spec and, especially, dial back the rhetoric. I know what the Clojure philosophy is, and it’s not some triviality. specs are fundamentally

Re: [ANN] Clojure 1.9.0-alpha1

2016-05-25 Thread Leif
I guess I'm confused why the Clojure philosophy of "data > fns > macros" is being ignored in this particular case, when the other schema libraries show that there is an army of end-users that want to do unexpected things with specifications, and to do that, it would be easiest if they had data

Re: [ANN] Clojure 1.9.0-alpha1

2016-05-25 Thread Leif
On Wednesday, May 25, 2016 at 4:46:57 PM UTC-4, kovasb wrote: > > > On Wed, May 25, 2016 at 3:01 PM, Mike Rodriguez > wrote: >> >> I always really liked that Prismatic Schema had a "data representation" >> and that seems to be the Clojure-way anyways. I haven't dug into this

Re: [ANN] Clojure 1.9.0-alpha1

2016-05-25 Thread kovas boguta
On Wed, May 25, 2016 at 3:01 PM, Mike Rodriguez wrote: > > I always really liked that Prismatic Schema had a "data representation" > and that seems to be the Clojure-way anyways. I haven't dug into this too > much yet, but I'm hoping that the Spec's do have some way to >

Re: [ANN] Clojure 1.9.0-alpha1

2016-05-25 Thread Mike Rodriguez
> > >> Is there a recommended way to introspect specs for our own purposes >>> (coercion, code generation)? An interpreter on the output of 'describe' >>> might work (although it's a little complicated for fn specs), but I wanted >>> to know if you all had any thoughts or plans for the future

Re: [ANN] Clojure 1.9.0-alpha1

2016-05-25 Thread Mark Engelberg
On Wed, May 25, 2016 at 6:38 AM, Alex Miller wrote: > So something like > > (defn valid-or-explain [spec data] > (let [v (s/valid? spec data)] > (when-not v (s/explain spec data)) > v)) > > Right, that's what I was originally thinking. The form Sean Corfield

Re: [ANN] Clojure 1.9.0-alpha1

2016-05-25 Thread Sean Corfield
I meant more that a failed pre-/post-condition throws AssertionError rather than printing to the console and that a failure using clojure.spec should still do the same thing. The valid-or-explain function suggested would “work” in terms of being a predicate but the AssertionError wouldn’t

Re: [ANN] Clojure 1.9.0-alpha1

2016-05-25 Thread Ambrose Bonnaire-Sergeant
In practice this is a lot of information though, and often it's a coincidence that the dispatch entry comes first since maps are unordered. See the following error I found in practice using namespaced keywords pervasively missing a :spec-play.destruct/type|or method. It's rather large and I'm

Re: [ANN] Clojure 1.9.0-alpha1

2016-05-25 Thread Alex Miller
Rich pointed out that this is telling you the predicate :my.domain/event-type and the value it received: {:event/type :event/restart} which seems to be telling you everything you need to know wrt to the missing method. The dispatch method is opaque (even though it is simple here), so doesn't

Re: [ANN] Clojure 1.9.0-alpha1

2016-05-25 Thread Alex Miller
We do not plan to create or support a backport lib for Clojure 1.8. Mostly just a matter of choosing not to spend our time on maintaining multiple code bases. On Wednesday, May 25, 2016 at 8:34:41 AM UTC-5, Gary Trakhman wrote: > > It would be helpful to make clojure.spec available as a lib for

Re: [ANN] Clojure 1.9.0-alpha1

2016-05-25 Thread Alex Miller
We will be adding CLJ-1910 and CLJ-1919 for namespaced map literals and namespaced map destructuring in an alpha relatively soon. Nothing else to announce re 1.9 right now. On Wednesday, May 25, 2016 at 1:52:33 AM UTC-5, Tatu Tarvainen wrote: > > > Are there plans for what will be the release

Re: [ANN] Clojure 1.9.0-alpha1

2016-05-25 Thread Alex Miller
So something like (defn valid-or-explain [spec data] (let [v (s/valid? spec data)] (when-not v (s/explain spec data)) v)) I'll mention it to Rich, not sure though. On Tuesday, May 24, 2016 at 10:56:03 PM UTC-5, puzzler wrote: > > One thing that has always limited the value of pre

Re: [ANN] Clojure 1.9.0-alpha1

2016-05-25 Thread Gary Trakhman
It would be helpful to make clojure.spec available as a lib for 1.8. I have opted to backport clojure.spec (a 30-second copy/paste job) into our application running on 1.8 for an easy transition, and maybe others would be more comfortable bringing in a lib until 1.9 is further along. That would

Re: [ANN] Clojure 1.9.0-alpha1

2016-05-25 Thread Alex Miller
Probably - can you file a jira for that? On Tuesday, May 24, 2016 at 10:53:43 PM UTC-5, Ambrose Bonnaire-Sergeant wrote: > > Thanks for the guide Alex. > > Is it possible to get more information in the "no method" error returned by > multi-spec? > > (s/explain :event/event {:event/type

Re: [ANN] Clojure 1.9.0-alpha1

2016-05-25 Thread Alex Miller
On Tuesday, May 24, 2016 at 7:26:57 PM UTC-5, Leif wrote: > > Hi, Alex, thanks for the responsiveness. > > The paths refer to tags in the schemas, not keys in the map. However, this >> has been asked about several times today and Rich has added support for a >> :in clause that will track the

Re: [ANN] Clojure 1.9.0-alpha1

2016-05-25 Thread Alex Miller
On Tuesday, May 24, 2016 at 5:45:47 PM UTC-5, Sean Corfield wrote: > > We have 1.9.0 Alpha 1 in QA at World Singles and plan to start using > clojure.spec this week. We’ve gone to production on Alpha builds ever since > 1.3 and almost never had any problems (in five years – time has flown >

Re: [ANN] Clojure 1.9.0-alpha1

2016-05-25 Thread Rick Moynihan
Congratulations on the alpha release! I'm also curious what the plans are for 1.9 beyond clojure.spec (which looks awesome btw). R. On 25 May 2016 at 07:52, Tatu Tarvainen wrote: > > Are there plans for what will be the release content of 1.9? > I didn't see anything in

Re: [ANN] Clojure 1.9.0-alpha1

2016-05-25 Thread Tatu Tarvainen
Are there plans for what will be the release content of 1.9? I didn't see anything in the Clojure jira. Particularly I'm interested if namespaced maps syntax will be included as clojure.spec encourages namespacing keyword keys. tiistai 24. toukokuuta 2016 20.04.45 UTC+3 Alex Miller

Re: [ANN] Clojure 1.9.0-alpha1

2016-05-25 Thread Mark Engelberg
On Tue, May 24, 2016 at 11:01 PM, wrote: > Bear in mind that you can catch the exception thrown by a > pre-/post-condition so printing to stdout is not the right behavior. > Ah, I didn't realize that it was okay to throw an error inside a pre-/post-condition test, but that

RE: [ANN] Clojure 1.9.0-alpha1

2016-05-25 Thread sean
Bear in mind that you can catch the exception thrown by a pre-/post-condition so printing to stdout is not the right behavior. Are you thinking about something like this? (when-not (s/valid? spec arg) (throw (AssertionError. (with-out-str (s/explain spec arg))

Re: [ANN] Clojure 1.9.0-alpha1

2016-05-24 Thread Mark Engelberg
On Tue, May 24, 2016 at 8:55 PM, Mark Engelberg wrote: > I would like to see function in the spec namespace that returns true if > input conforms to a spec, otherwise returns false and prints to standard > out an explanation of the failure. Sort of a valid-or-explain

Re: [ANN] Clojure 1.9.0-alpha1

2016-05-24 Thread Mark Engelberg
One thing that has always limited the value of pre and post conditions is that they don't give useful error messages. I would like to see function in the spec namespace that returns true if input conforms to a spec, otherwise returns false and prints to standard out an explanation of the failure.

Re: [ANN] Clojure 1.9.0-alpha1

2016-05-24 Thread Ambrose Bonnaire-Sergeant
Thanks for the guide Alex. Is it possible to get more information in the "no method" error returned by multi-spec? (s/explain :event/event {:event/type :event/restart}) ;; val: {:event/type :event/restart} fails predicate: my.domain/event-type, no method It would be nice to mention exactly

Re: [ANN] Clojure 1.9.0-alpha1

2016-05-24 Thread Colin Fleming
I'll also need a spec translator (from s/form or s/describe, I guess - I'm not clear on the difference), and I'm very interesting in seeing any details if someone gets to it before I do. Cheers, Colin On 25 May 2016 at 12:38, Timothy Baldridge wrote: > The output of

Re: [ANN] Clojure 1.9.0-alpha1

2016-05-24 Thread Timothy Baldridge
The output of `spec/form` is helps a bit with this, as it namespaces vars, keywords and symbols correctly. I've had it on my list to write a translator for specs sometime in the near future, but I haven't done it yet. True the output of `form` isn't as uniform as I would like (sexprs instead of

Re: [ANN] Clojure 1.9.0-alpha1

2016-05-24 Thread Leif
Hi, Alex, thanks for the responsiveness. The paths refer to tags in the schemas, not keys in the map. However, this > has been asked about several times today and Rich has added support for a > :in clause that will track the key paths to master and that will be in > alpha2. > Where is this

Re: [ANN] Clojure 1.9.0-alpha1

2016-05-24 Thread Sean Corfield
We have 1.9.0 Alpha 1 in QA at World Singles and plan to start using clojure.spec this week. We’ve gone to production on Alpha builds ever since 1.3 and almost never had any problems (in five years – time has flown past!). What sort of tradeoffs have you in mind regarding whether to use

Re: [ANN] Clojure 1.9.0-alpha1

2016-05-24 Thread Alex Miller
On Tuesday, May 24, 2016 at 4:54:40 PM UTC-5, Leif wrote: > > Spec usage guide questions: > > There is a small typo in the 'Collections' section (pretend this is a > question): > > (s/conform (s/coll-of number? #{} #{5 10 2})) > ;; should be > (s/conform (s/coll-of number? #{}) #{5 10 2}) > >

Re: [ANN] Clojure 1.9.0-alpha1

2016-05-24 Thread Leif
Spec usage guide questions: There is a small typo in the 'Collections' section (pretend this is a question): (s/conform (s/coll-of number? #{} #{5 10 2})) ;; should be (s/conform (s/coll-of number? #{}) #{5 10 2}) Is there a technical reason why the paths reported by 's/explain' for regex

Re: [ANN] Clojure 1.9.0-alpha1

2016-05-24 Thread Alex Miller
Yes, I'll add that in the next deploy. Thanks. On Tuesday, May 24, 2016 at 2:45:39 PM UTC-5, Nando Breiter wrote: > > Alex, > > The spec usage guide is excellent! Thank you! > > Perhaps a small correction? Below the example: > > (s/valid? ::person {::first-name "Elon" ::last-name "Musk" ::email "

Re: [ANN] Clojure 1.9.0-alpha1

2016-05-24 Thread Nando Breiter
Alex, The spec usage guide is excellent! Thank you! Perhaps a small correction? Below the example: (s/valid? ::person {::first-name "Elon" ::last-name "Musk" ::email " e...@example.com"}) ;; Fails required key check You might want to include what that spec call returns under it, which I

Re: [ANN] Clojure 1.9.0-alpha1

2016-05-24 Thread Alex Miller
No. I would expect on the order of months. On Tuesday, May 24, 2016 at 1:52:12 PM UTC-5, Gary Trakhman wrote: > > The inevitable question: is there a release schedule for 1.9 yet? I would > love to start writing greenfield spec code ASAP, knowing that would help me > communicate tradeoffs. >

Re: [ANN] Clojure 1.9.0-alpha1

2016-05-24 Thread Gary Trakhman
The inevitable question: is there a release schedule for 1.9 yet? I would love to start writing greenfield spec code ASAP, knowing that would help me communicate tradeoffs. On Tue, May 24, 2016 at 1:05 PM Alex Miller wrote: > You know how you always see the typo right after

Re: [ANN] Clojure 1.9.0-alpha1

2016-05-24 Thread Alex Miller
You know how you always see the typo right after you hit send? - Leiningen: [org.clojure/clojure "1.9.0-alpha1"] On Tuesday, May 24, 2016 at 12:04:45 PM UTC-5, Alex Miller wrote: > > Clojure 1.9.0-alpha1 is now available. > > Try it via > - Download: >

[ANN] Clojure 1.9.0-alpha1

2016-05-24 Thread Alex Miller
Clojure 1.9.0-alpha1 is now available. Try it via - Download: https://repo1.maven.org/maven2/org/clojure/clojure/1.9.0-alpha1 - Leiningen: [org.clojure/clojure "1.8.0-alpha2"] 1.9.0-alpha1 includes the first release of clojure.spec . A usage guide for spec is now