This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-10-28
Channels
- # aleph (4)
- # announcements (5)
- # babashka (28)
- # babashka-sci-dev (13)
- # beginners (63)
- # calva (76)
- # cider (113)
- # clara (7)
- # clj-kondo (42)
- # cljdoc (1)
- # clojure (170)
- # clojure-europe (20)
- # clojure-nl (17)
- # clojure-norway (3)
- # clojure-spec (12)
- # clojure-sweden (1)
- # clojure-uk (6)
- # clojurescript (55)
- # clojureverse-ops (1)
- # consulting (1)
- # core-async (9)
- # cursive (16)
- # data-science (1)
- # datascript (8)
- # datomic (27)
- # emacs (14)
- # events (1)
- # fulcro (10)
- # graphql (9)
- # gratitude (1)
- # jobs (6)
- # jobs-discuss (5)
- # leiningen (10)
- # lsp (35)
- # missionary (4)
- # nextjournal (9)
- # off-topic (46)
- # pathom (15)
- # pedestal (5)
- # polylith (37)
- # portal (15)
- # re-frame (22)
- # reagent (4)
- # reitit (5)
- # reveal (18)
- # shadow-cljs (20)
- # tools-deps (7)
- # xtdb (10)
Hi! At one time there was a function spec* in spec-alpha2 that allowed programmatic definition of specs. I don’t see that in the current SHA version. Is it still possible to define specs programmatically?
Are you looking for register
@peterd? https://github.com/clojure/spec-alpha2/blob/master/src/main/clojure/clojure/alpha/spec.clj#L429
I am looking at some code I wrote about two years ago. (Wish I could recall!) I was using both s/spec* and s/register. I was using backquoted forms or variable values with spec*. Hmmm… It looks like the spec* calls are typically wrapped in a s/register, but s/register takes a spec, not a body (form) so my guess is that register isn’t going to allow programmatic operation???
You probably want resolve-spec or maybe create-spec depending on what you're doing
resolve-spec takes a form and returns a spec object
https://github.com/clojure/spec-alpha2/commit/bab9b91d2b8490e9c7bdbf3b1500636b28bb4e75
I think https://clojure.github.io/spec-alpha2/ is relatively synced to the code too