This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-12-21
Channels
- # adventofcode (60)
- # aleph (2)
- # announcements (3)
- # architecture (2)
- # babashka (12)
- # beginners (90)
- # calva (14)
- # cider (32)
- # clj-kondo (1)
- # clj-together (7)
- # cljsrn (4)
- # clojars (10)
- # clojure (161)
- # clojure-dev (110)
- # clojure-europe (58)
- # clojure-nl (3)
- # clojure-spec (35)
- # clojure-taiwan (1)
- # clojure-uk (24)
- # clojuredesign-podcast (3)
- # clojurescript (27)
- # conjure (47)
- # cursive (17)
- # data-science (1)
- # datomic (1)
- # depstar (6)
- # fulcro (20)
- # java (4)
- # jobs-rus (1)
- # luminus (4)
- # malli (10)
- # off-topic (8)
- # re-frame (4)
- # reagent (1)
- # reitit (9)
- # reveal (1)
- # rewrite-clj (8)
- # ring (3)
- # sci (44)
- # shadow-cljs (5)
- # spacemacs (6)
- # specter (8)
- # tools-deps (6)
- # vim (1)
- # xtdb (11)
@raymcdermott listened that defn, good stuff. Finnish is simple, just pronounce the way you write it, right? 😉
3
😄 3
Can confirm, Ray is a tit ;) @raymcdermott
@rutledgepaulv the entry handling is bit too hard atm, but not sure what woud be a simpler way.
oh, undocumeted, untested and had a bug, but maybe something like this?
(mu/find
[:map [:b {:optional true} int?]]
:b)
; => [:b {:optional true} int?]
(-> [:map [:a [:map [:b {:optional true} int?]]]]
(mu/get :a)
(mu/find :b))
; => [:b {:optional true} int?]
👍 3
where mu/find
is just sugar on top of the hidden feature of “give me the entry tuple” of:
(-> [:map [:a [:map [:b {:optional true} int?]]]]
(mu/get-in [:a [::m/find :b]]))
; => [:b {:optional true} int?]
btw, those interested in the sequence schemas, here’s the PR (draft): https://github.com/metosin/malli/pull/317
(m/explain
[:+ [:cat*
[:prop string?]
[:val [:alt* [:s string?] [:b boolean?]]]]]
["-server" :foo "-verbose" true "-user" "joe"])
=>
{:schema [:+ [:cat* [:prop string?] [:val [:alt* [:s string?] [:b boolean?]]]]],
:value ["-server" :foo "-verbose" true "-user" "joe"],
:errors (#Error{:path [0 :val :s], :in [1], :schema string?, :value :foo}
#Error{:path [0 :val :b], :in [1], :schema boolean?, :value :foo})}
🔥 3