This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-07-24
Channels
- # announcements (5)
- # beginners (184)
- # calva (32)
- # cider (29)
- # clj-kondo (1)
- # cljdoc (29)
- # cljsrn (6)
- # clojure (44)
- # clojure-dev (36)
- # clojure-europe (9)
- # clojure-italy (18)
- # clojure-losangeles (1)
- # clojure-nl (3)
- # clojure-spec (7)
- # clojure-uk (30)
- # clojure-ukraine (1)
- # clojuredesign-podcast (8)
- # clojurescript (65)
- # code-reviews (21)
- # core-async (25)
- # cursive (51)
- # data-science (3)
- # datascript (2)
- # datomic (25)
- # emacs (14)
- # events (1)
- # figwheel-main (3)
- # fulcro (3)
- # graalvm (5)
- # jackdaw (17)
- # kaocha (14)
- # luminus (5)
- # off-topic (17)
- # pathom (7)
- # pedestal (2)
- # re-frame (71)
- # reagent (25)
- # shadow-cljs (83)
- # spacemacs (31)
- # sql (92)
- # tools-deps (23)
- # vim (102)
- # xtdb (5)
Hi gents! Is there any way to use spec/keys
definition for creating new spec as set of keys? For example I have spec:
(s/def ::schema
(s/keys :req-un [::id
::name
::active?]
:opt-un [::age]))
I want to create other spec based on ::schema
(s/def ::fields
#{:id :name :active? :age})
How would I generate a random walk with clojure.spec.gen? Or, how would I generate a successive value based on the current value?
I think the easiest way would be to use spec.gen
for starting values and then use iterate
to do the actual random walks. you could use specs
inside the fn you pass to iterate
to constrain the return values.
I think the easiest way would be to use spec.gen
for starting values and then use iterate
to do the actual random walks. you could use specs
inside the fn you pass to iterate
to constrain the return values.
does anyone have any thoughts on making spec
predicates usable through a java API? should I just use spec/conform
to define the class methods I want to expose to the Java API?
can you explain more what you're trying to do?
I'm using core.spec
to define a series of data integrity/quality predicates that some data needs to conform to. I would like for those specs to be available as widely as possible, including for other consumers of the data who may be using Java instead of Clojure.