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

[ANN] json-schema 0.7.2

2016-05-24 Thread Tatu Tarvainen
I'd like to announce a new version of json-schema. Leiningen coordinates: [webjure/json-schema "0.7.2"] Github: https://github.com/tatut/json-schema The validator valdiates JSON documents against JSON schema (http://json-schema.org/). There are two modes: a runtime validate function, which

Re: Handle error many lazy sequence

2016-05-24 Thread Asim Jalis
Another option: put the try catch inside the inner loop where you are doing the failing operation. > On May 19, 2016, at 5:36 AM, Fluid Dynamics wrote: > >> On Thursday, May 19, 2016 at 7:50:57 AM UTC-4, khairul isan wrote: >> Hello all, >> >> I have problem on handle many

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: clojure.spec

2016-05-24 Thread Elliot
Super super excited for this feature, thanks so much for creating this. In the runtime-validation case, the guide mentions: 1. Calling `valid?` in a precondition 2. Calling `conform` in the fn implementation However neither of these appear to use the `fdef`/`instrument` combo, which seems the

Re: clojure.spec

2016-05-24 Thread Elliot
Super super excited for this feature, thanks so much for creating this. In the runtime-validation case, the guide mentions: 1. Calling `valid?` in a precondition 2. Calling `conform` in the fn implementation However neither of these appear to use the `fdef`/`instrument` combo, which seems the

Re: clojure.spec

2016-05-24 Thread Stan Dyck
I appreciate the wisdom of separating the existence of a key from the conformance of the values of that key. I wonder though if there is a way to specify co-constraints; a situation where the conformance of the value of one key depends on the existence of and perhaps the value of another key.

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

[ANN] Pink 0.3.0

2016-05-24 Thread Steven Yi
Hi All, I'd like to announce the release of Pink 0.3.0: https://clojars.org/kunstmusik/pink [kunstmusik/pink "0.3.0"] Pink is an audio engine library for making music systems and compositions. The ChangeLog is available at: https://github.com/kunstmusik/pink/blob/master/CHANGELOG.md This

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: clojure.spec

2016-05-24 Thread Rich Hickey
Fixed on master, thanks for the report. > On May 24, 2016, at 2:05 PM, Ambrose Bonnaire-Sergeant > wrote: > > Thanks Rich. Now it seems test.check is eager to generate very large > individual samples, which sounds > like a different problem. > > (s/def ::a

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: clojure.spec

2016-05-24 Thread scott stackelhouse
I restructured my data to make this section an optional sub-map, which I think is actually better anyway. On Tuesday, May 24, 2016 at 11:08:27 AM UTC-7, scott stackelhouse wrote: > > Ok. > > Thanks all who have worked on this, btw. It is incredibly timely for me > and is already great help

Re: clojure.spec

2016-05-24 Thread scott stackelhouse
Ok. Thanks all who have worked on this, btw. It is incredibly timely for me and is already great help for a work project. --Scott On Tuesday, May 24, 2016 at 10:57:26 AM UTC-7, Rich Hickey wrote: > > ‘and' and ‘or’ are not currently supported in :opt > > > > On May 24, 2016, at 1:45 PM,

Re: clojure.spec

2016-05-24 Thread Ambrose Bonnaire-Sergeant
Thanks Rich. Now it seems test.check is eager to generate very large individual samples, which sounds like a different problem. (s/def ::a (s/nilable (s/cat :a ::a :b ::b :c ::c))) (s/def ::b (s/nilable (s/cat :a ::a

Re: clojure.spec

2016-05-24 Thread Rich Hickey
‘and' and ‘or’ are not currently supported in :opt > On May 24, 2016, at 1:45 PM, scott stackelhouse > wrote: > > I'm having a problem writing a spec for a map with some required keywords and > some optional keywords. The caveat here is that the optional

Re: clojure.spec

2016-05-24 Thread scott stackelhouse
I'm having a problem writing a spec for a map with some required keywords and some optional keywords. The caveat here is that the optional keywords are all or none... that is they are optional but if one is present they must all be present. What I tried to write was: (s/keys :req [::a ::b

Re: clojure.spec

2016-05-24 Thread Rich Hickey
And now, in the alpha release branching gens *are* lazy, so gen calls on recursive specs are fast. > On May 23, 2016, at 6:49 PM, Rich Hickey wrote: > > Currently gens are not lazy, so entire tree is generated. This is because a) > test.check isn’t lazy either and b) we

Re: clojure.spec

2016-05-24 Thread JvJ
So happy that there's now a standard way to do this! It sounds like it would help with my latest project. Unfortunately, my latest project is called "SPECS" so I guess I'll have to find a different name. On Monday, 23 May 2016 07:12:29 UTC-7, Rich Hickey wrote: > > Introducing

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

Cells aka Dataflow aka FRP now pure CLJC

2016-05-24 Thread hiskennyness
Last week was supposed to be a port from a Clojure version to a CLJS version but for the heck of it I did it all in CLJC and (OMG) I now have my cherished little project running either way: https://github.com/kennytilton/rube Yes, that is my third and last home for the beast. Clojure: lein

Re: clojure.spec

2016-05-24 Thread Steve Miner
> On May 24, 2016, at 8:10 AM, Alex Miller wrote: > > The first use is a namespace alias and the second is a var - they don't > overlap in usage. Right, but it’s still a potential source of confusion. The explanation distracts from the point of the example which is to

Re: clojure.spec

2016-05-24 Thread Atamert Ölçgen
Thanks Alex! I didn't know this. On Tue, May 24, 2016 at 3:10 PM, Alex Miller wrote: > The first use is a namespace alias and the second is a var - they don't > overlap in usage. > > > On Tuesday, May 24, 2016 at 2:28:11 AM UTC-5, Atamert Ölçgen wrote: >> >> Isn't s

Re: clojure.spec

2016-05-24 Thread Alex Miller
The first use is a namespace alias and the second is a var - they don't overlap in usage. On Tuesday, May 24, 2016 at 2:28:11 AM UTC-5, Atamert Ölçgen wrote: > > Isn't s redefined in this example: > > user=> (require '[clojure.spec :as s]) > (s/def ::even? (s/and integer? even?)) > (s/def ::odd?

[ANN] Chestnut 0.12.0

2016-05-24 Thread Arne Brasseur
Chestnut is a Leiningen template for web apps that aims to be super beginner friendly. It comes with Figwheel and Om (default) or Reagent. The generated README contains elaborate instructions to get you up to speed. - This release comes with - upgrades to dependencies (ClojureScript,

Re: clojure.spec

2016-05-24 Thread Atamert Ölçgen
Isn't s redefined in this example: user=> (require '[clojure.spec :as s]) (s/def ::even? (s/and integer? even?)) (s/def ::odd? (s/and integer? odd?)) (s/def ::a integer?) (s/def ::b integer?) (s/def ::c integer?) (def s (s/cat :forty-two #{42} :odds (s/+ ::odd?) :m

RE: clojure.spec

2016-05-24 Thread sean
OK, that explains a lot. Thank you. That needs to be clarified on the web page I think… Sean Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org From: Alex Miller -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this