This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-12-23
Channels
- # adventofcode (13)
- # announcements (7)
- # atom-editor (2)
- # babashka (6)
- # beginners (77)
- # biff (2)
- # calva (14)
- # cider (25)
- # circleci (2)
- # clj-on-windows (39)
- # clojars (1)
- # clojure (36)
- # clojure-belgium (4)
- # clojure-europe (78)
- # clojure-norway (25)
- # clojure-spec (1)
- # clojurescript (11)
- # clr (1)
- # cursive (1)
- # datahike (43)
- # datomic (6)
- # dev-tooling (3)
- # emacs (5)
- # exercism (1)
- # jobs (1)
- # jobs-discuss (3)
- # kaocha (2)
- # lsp (32)
- # malli (4)
- # music (1)
- # off-topic (14)
- # pathom (4)
- # reitit (14)
- # shadow-cljs (5)
- # tools-deps (3)
- # vim (1)
- # xtdb (5)
Hi, is there a way to apply malli function schemas (`m/=>`) to macros? Minimal example:
(def ?ErrOrOpts
[:or
[:fn {:error/message "should be Throwable"} throwable?]
[:map {:error/message "should be a map"}
[:throwable [:fn {:error/message "should be Throwable"} throwable?]]]])
(def ?LogArgs
[:function
[:=> [:cat ?Message] :nil]
[:=> [:cat ?Message ?ErrOrOpts] :nil]])
(m/=> foo ?LogArgs)
(defmacro foo
([msg] nil)
([msg err-or-opts] nil))
(comment
(foo "hello")
)
blows up with:
Invalid function arity (3):
((foo "hello") nil "hello")
....
It seems that macro call is wrapped