This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-09
Channels
- # aleph (4)
- # beginners (31)
- # boot (33)
- # cider (7)
- # cljs-dev (263)
- # cljsrn (1)
- # clojure (33)
- # clojure-austin (2)
- # clojure-dev (1)
- # clojure-russia (6)
- # clojure-spec (19)
- # clojure-uk (7)
- # clojurescript (79)
- # cursive (21)
- # datascript (1)
- # datomic (13)
- # dirac (12)
- # emacs (15)
- # hoplon (26)
- # lein-figwheel (3)
- # leiningen (1)
- # luminus (5)
- # lumo (20)
- # mount (1)
- # off-topic (17)
- # om (13)
- # onyx (24)
- # parinfer (70)
- # pedestal (2)
- # re-frame (19)
- # reagent (1)
- # ring-swagger (3)
- # unrepl (8)
- # untangled (58)
- # yada (2)
This didn't seem fancy, but it gave me a stack overflow: (s/coll-of map? :kind seqable?)
In case it's not clear, I'm attempting to express, "This here data is a sequence of maps"
Since another way to express that is, (s/* map?)
, I'm using that. But what a strange error that was. (SOLVED)
is seqable?
a valid :kind
?
"`:kind` - a predicate or spec that the incoming collection must satisfy, such as vector?
"
I'm planning to release schpec with defn+spec
today https://github.com/gfredericks/schpec/commit/4b0de0bc836111fc9953e37c68ca1756a0d09bb8
/cc @olivergeorge
Couldn't it be made more efficient by conforming 1 arg at a time instead of creating a s/cat at invoke time? That would also allow to avoid & args?
Ah but you do this to pattern match depending on arg type for same arg length. Nevermind
hey wow. that goes beyond typing the defns. interesting stuff.
I've been looking at porting some ocaml code. they rely heavily on functions with match statements which looks a lot like this. (I've been using core.match)
Here's a random example: https://github.com/links-lang/links/blob/master/queryshredding.ml#L1234
That's pretty much sugar for the match statement
okay, I released defn+spec
in case you like that sort of thing
https://github.com/gfredericks/schpec#comgfredericksschpecdefnspecdefn