Fork me on GitHub
#clojure-spec
<
2016-08-16
>
borkdude07:08:48

@arohner: do you have any examples how to use the result of parse-spec?

sandbags13:08:26

Has anyone come across a spec for Hiccup markup? I’m just getting started and not sure I’m up to trying to figure out if & how to express it.

sandbags13:08:34

at the moment I am copping out and using vector? 🙂

mpenet13:08:38

start from a tag, then attributes then how they relate to each other (and themselves). should be relatively easy

sandbags13:08:54

thanks Max but I’m in a hurry and not yet up to the nested spec stuff, if the answer is “no” that’s fine too

burbma17:08:55

In clojure I can do (gen/generate (s/gen int?)) ;; => 1094 or (gen/generate (s/gen boolean?)) ;; => false. In clojurescript I can do (gen/generate (s/gen int?)) ;; => -308. But in clojurescript I can’t do (gen/generate (s/gen boolean?)) ;; => Error: Unable to construct gen at: [] for: function cljs$core$boolean_QMARK_(x){return (x === true) || (x === false);}]. What’s happening in clj vs cljs to make this difference?

seancorfield17:08:07

Sounds like no one has written the generator for boolean? in cljs yet.

seancorfield17:08:41

Are you on the very latest cljs version? If so, file a JIRA ticket.

burbma18:08:22

I’m on 1.9.216.

Alex Miller (Clojure team)20:08:58

agreed, that should work

seancorfield20:08:08

I see spec’ing of ns has hit master snapshot now @alexmiller ? My build just broke 🙂 This is a good thing — turns out we had (import …) in a test namespace instead of (:import …)

seancorfield20:08:42

Oh, and a require instead of :require in another file...

Alex Miller (Clojure team)20:08:29

that’s definitely the most common kind of failure I found in ns in the wild

Alex Miller (Clojure team)20:08:10

there are a number of popular libraries that currently fail with the new specs - I’ve filed PRs on all the ones I found and they’ve all been merged, but afaik most do not yet have new released versions

Alex Miller (Clojure team)20:08:20

I’ll have some more guidance on some of this after we release an alpha

seancorfield21:08:37

Wow, I’m running into more and more of those ns bugs!

seancorfield21:08:29

Well, this is why we always do multi-version testing against master and our current selected release version!

seancorfield21:08:58

We had a missing : in six files in all.

Alex Miller (Clojure team)21:08:26

well I found instances in both Clojure and ClojureScript too so you’re in good company :)