This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-22
Channels
- # announcements (6)
- # babashka (8)
- # beginners (136)
- # cider (5)
- # cljs-dev (1)
- # cljsrn (1)
- # clojure (198)
- # clojure-argentina (4)
- # clojure-australia (1)
- # clojure-europe (25)
- # clojure-italy (4)
- # clojure-nl (5)
- # clojure-poland (1)
- # clojure-spec (4)
- # clojure-uk (4)
- # clojuredesign-podcast (4)
- # clojurescript (36)
- # conjure (11)
- # data-science (1)
- # datomic (6)
- # defnpodcast (1)
- # deps-new (5)
- # emacs (7)
- # events (1)
- # fulcro (10)
- # graalvm (9)
- # graalvm-mobile (10)
- # helix (9)
- # introduce-yourself (1)
- # jackdaw (1)
- # jobs-discuss (5)
- # kaocha (6)
- # lsp (10)
- # malli (11)
- # missionary (28)
- # off-topic (2)
- # pathom (24)
- # pedestal (7)
- # portal (1)
- # re-frame (12)
- # reagent (2)
- # reitit (1)
- # remote-jobs (1)
- # sci (7)
- # shadow-cljs (6)
- # sql (6)
- # tools-deps (10)
- # vim (9)
- # xtdb (19)
Hey guys, very quick and simple question, I want to combine two schemas to validate for case a and case b, and I’d rather not involve regexes, and have one of the validation schemas to have the values not be of a certain set. How would I rewrite this in a correct manner?
(def NotABC
(m/schema
[:map
[:field [:not [:enum "a" "b" "c"]]]]))
Thanks!@ikitommi that’s exactly what I thought as well, but in the REPL:
Execution error (ExceptionInfo) at malli.core/-fail! (core.cljc:79).
:malli.core/invalid-schema {:schema :not}
thanks for the response 👌welp, that does indeed solve the issue, thanks haha
@ikitommi Looks like the new function instrumentation only works for clj, but not for cljs yet. E.g. mi/instrument!
and dev/start
would throw when I use them in cljs. Is there any plan to add cljs support?
@wxitb2017 help most welcome on cljs-support.
Initial attempt at writing a malli based parser for EDN datalog syntax
https://gist.github.com/bsless/632b4040a2b2ad7469369f52cd610c06
Can't figure out why ::clause
breaks and it's getting late here. Feel free to poke at the code, suggest improvements, feedback, etc.
Direct translation to spec works for parsing the forms, insights as to why it didn't work with malli most welcome, updated the gist