This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-07-27
Channels
- # beginners (43)
- # boot (1)
- # cider (7)
- # cljdoc (10)
- # clojure (110)
- # clojure-boston (1)
- # clojure-finland (2)
- # clojure-italy (19)
- # clojure-losangeles (1)
- # clojure-new-zealand (1)
- # clojure-nl (4)
- # clojure-spec (34)
- # clojure-uk (163)
- # clojurescript (136)
- # code-reviews (1)
- # component (13)
- # cursive (18)
- # datomic (99)
- # emacs (14)
- # events (4)
- # fulcro (14)
- # hoplon (15)
- # hyperfiddle (3)
- # jobs (3)
- # jobs-discuss (1)
- # lein-figwheel (10)
- # onyx (1)
- # pedestal (8)
- # re-frame (5)
- # reitit (4)
- # rum (1)
- # shadow-cljs (317)
- # spacemacs (24)
- # specter (9)
- # sql (2)
- # tools-deps (6)
- # yada (3)
(type (resolve 'string?))
;;=> clojure.lang.Var
user> (type string?)
;;=> clojure.core$string_QMARK___5132
resolve isn’t a spec function it’s in core. Suppose I started with "string?"
, how can I get to the clojure.core$string_QMARK_...
? (resolve (symbol "string?))
won’t do it as we’ve seen.
if u want to see what it does, you can generally just try s/exercise
and see what it produces
s/exercise
gives the same error for the (resolve (symbol "string?"))
version of the spec.
or deref, or the shorthand @
Any idea when we will get this fix https://dev.clojure.org/jira/browse/CLJ-2003 in? We are still running a patched version.
In queue to get screened
Thanks
Last week at clojure/nyc I shared my experience, as a spec n00b, using spec to specify other people’s data structures … here’s the video if anyone’s interested: https://www.youtube.com/watch?v=eqfSifXaXnw
And for those in the Boston area I’ll be sharing this again at the Boston Clojure Group on 9 August: https://www.meetup.com/Boston-Clojure-Group/events/tjztcpyxlbmb/
Hello all, how
(defn ^:private menor? [n t]
(<= (count n) t))
(s/def ::limite-tamanho menor?)
(s/valid? ::limite-tamanho <what is in here?>)
I don't understand how your spec predicate could be a function of two args
perhaps (partial menor? some-n)
?
right, but how can you use that directly as a spec predicate? where would the other arg come from?
@noisesmith I´ll check many specs from vector, like fields in form -> [[:code "Error code" ::limite-tamanho 6] [:name "Error name" ::limite-tamanho 15]]
maybe I'm missing some spec feature that would make this work, but I still don't understand how you'd make spec supply two args to your spec
and as far as I know you can't use a neighbor or parent data in the check for a key
which is equivalent to what I proposed with partial above, right?