This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-10-07
Channels
- # announcements (9)
- # beginners (155)
- # bristol-clojurians (1)
- # calva (49)
- # chlorine-clover (36)
- # cider (10)
- # clara (6)
- # clj-kondo (14)
- # clojars (28)
- # clojure (226)
- # clojure-australia (1)
- # clojure-berlin (12)
- # clojure-czech (1)
- # clojure-europe (26)
- # clojure-germany (1)
- # clojure-nl (2)
- # clojure-uk (32)
- # clojurescript (9)
- # conjure (21)
- # datascript (3)
- # datomic (43)
- # emacs (3)
- # figwheel-main (16)
- # fulcro (17)
- # graalvm (9)
- # helix (4)
- # lambdaisland (3)
- # malli (13)
- # off-topic (12)
- # pathom (7)
- # re-frame (10)
- # reitit (9)
- # rewrite-clj (2)
- # shadow-cljs (41)
- # spacemacs (6)
- # specter (3)
- # test-check (5)
- # tools-deps (9)
- # tree-sitter (1)
- # vim (15)
- # xtdb (3)
welcome @kari.marttila! first one definitely a typo, could not find the latter. But PR welcome to fix any typos.
scratch that. I don’t know what you would use to replace the second one. I’ll PR for the typo
here’s the second one…
Custom registry
Example to create a custom registry without the default core predicates and with :bool and :pos-int Schemas:
(def registry
(merge
(m/class-schemas)
(m/comparator-schemas)
(m/base-schemas)
{:bool (m/-simple-schema {:type :bool, :pred boolean?})
:pos-int (m/-simple-schema {:type :pos-int, :pred pos-int?})}))
(m/validate [:or :bool :pos-int] 'kikka {:registry registry})
; => false
(m/validate [:or :bool :post-int] 123 {:registry registry})
; => true
ok, plan is to ship 0.1.0 tomorrow. going to clean up some internals and polish some docs, but anything relevant missing? the GraalVM tests? https://github.com/metosin/malli/pull/272
🎉 12