This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-01-04
Channels
- # announcements (1)
- # babashka (1)
- # beginners (84)
- # biff (22)
- # calva (9)
- # cider (8)
- # clerk (5)
- # clj-kondo (10)
- # clojure (105)
- # clojure-europe (13)
- # clojure-nl (1)
- # clojure-norway (44)
- # clojure-spec (4)
- # clojure-uk (6)
- # clojuredesign-podcast (36)
- # cursive (13)
- # datomic (24)
- # dev-tooling (8)
- # emacs (8)
- # hyperfiddle (4)
- # jobs (1)
- # leiningen (2)
- # london-clojurians (1)
- # lsp (5)
- # malli (6)
- # membrane (11)
- # nyc (1)
- # off-topic (14)
- # other-languages (8)
- # pathom (25)
- # pedestal (2)
- # re-frame (4)
- # releases (1)
- # remote-jobs (1)
- # shadow-cljs (98)
- # sql (5)
- # squint (1)
- # tools-deps (38)
- # vim (8)
- # xtdb (11)
qualified symbols are https://github.com/metosin/malli/pull/984 valid reference types:
(m/validate
[:map {:registry {:user/id :int
"user/name" :string
'user/country [:enum "UA"]}}
:user/id
"user/name"
'user/country]
{:user/id 123
"user/name" "Tiina"
'user/country "UA"})
; => true
🎉 2
@ben.sless draft for supporting Var Schema references: https://github.com/metosin/malli/pull/985
beauty of Clojure:
(defn var-registry []
(reify
Registry
(-schema [_ type] (if (var? type) @type)))
After this, Vars would work as naked keys too, but I don’t think this has any use case, just a bonus feature.
(def description :string)
(m/validate
[:map {:registry {:user/id :int
"user/name" :string
'user/country [:enum "UA"]}}
:user/id
"user/name"
'user/country
#'description] ;; here1
{:user/id 123
"user/name" "Tiina"
'user/country "UA"
#'description "var"}) ;; here2