This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-11-04
Channels
- # announcements (13)
- # beginners (51)
- # boot (3)
- # calva (10)
- # cider (20)
- # clj-kondo (55)
- # cljs-dev (60)
- # clojure (99)
- # clojure-europe (6)
- # clojure-gamedev (9)
- # clojure-italy (19)
- # clojure-nl (7)
- # clojure-spec (20)
- # clojure-uk (42)
- # clojurescript (96)
- # clojurex (37)
- # clojutre (1)
- # cursive (37)
- # data-science (2)
- # datomic (15)
- # defnpodcast (9)
- # duct (7)
- # emacs (6)
- # events (9)
- # fulcro (124)
- # jackdaw (4)
- # jobs (4)
- # leiningen (9)
- # malli (7)
- # mount (3)
- # off-topic (109)
- # other-languages (8)
- # re-frame (39)
- # reagent (4)
- # reitit (6)
- # remote-jobs (2)
- # rewrite-clj (36)
- # ring (4)
- # shadow-cljs (16)
- # spacemacs (16)
- # tools-deps (91)
- # vim (8)
- # yada (2)
Is there a preference to using either s/*
or s/coll-of
when we just want 'a collection of x`? I realise coll-of
has more tuning, but besides that, is there difference between (s/* ::foo)
and (s/coll-of ::foo)
?
Probably the most visible difference will be when you're nesting them - the regex based specs will make it work like it was "flattened" => I'd normally use coll-of
;
see also http://stackoverflow.com/questions/58636813/i-cant-understand-the-following-clojure-spec-error/58637063
Hmm, I thought this would work:
(s/fdef page-header-ribbon
:args (s/cat :title string? :extra (s/* any?))
:ret vector?)
(page-header-ribbon "Manage Users")
but I get Call to #'page-header-ribbon did not conform to spec:↵
val: "Manage Users" fails at: [:args] predicate: (cat :title string? :extra (* any?))...
What am I doing wrong?
is there more to that ... ?
Just the rest of the stack dump stuff, the JS objects etc
Call to #'page-header-ribbon did not conform to spec:↵
val: "Manage Users" fails at: [:args] predicate: (cat :title string? :extra (* any?))↵
:cljs.spec.alpha/spec #object[cljs.spec.alpha.t_cljs$spec$alpha44661]↵
:cljs.spec.alpha/value "Manage Users"↵
:cljs.spec.alpha/args "Manage Users"↵
:cljs.spec.alpha/failure :instrument
at a glance it doesn't look wrong to me
Ok, good, I’m not nuts then.
Probably some kind of dependency conflict or something.
I couldn't repro in either clj or cljs. maybe old repl statee?
It’s surviving multiple shutdown/clean/restart cycles. 🤷
in case that's different than what you're doing...
Not [cljs.spec.alpha :as s]
?
either should work
the clojure one aliases to the cljs one