This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-06-27
Channels
- # babashka (45)
- # beginners (44)
- # calva (3)
- # cider (14)
- # clara (4)
- # clj-commons (3)
- # clj-otel (4)
- # cljsjs (1)
- # cljsrn (111)
- # clojars (5)
- # clojure (62)
- # clojure-europe (14)
- # clojure-nl (2)
- # clojure-uk (4)
- # clojurescript (31)
- # community-development (16)
- # conjure (7)
- # cursive (9)
- # data-science (1)
- # datalevin (10)
- # docker (1)
- # emacs (20)
- # fulcro (7)
- # helix (10)
- # jobs (4)
- # lsp (22)
- # malli (35)
- # meander (12)
- # music (1)
- # nbb (2)
- # off-topic (5)
- # pathom (3)
- # quil (1)
- # re-frame (12)
- # react (6)
- # reagent (18)
- # releases (1)
- # remote-jobs (1)
- # rewrite-clj (4)
- # ring (1)
- # shadow-cljs (10)
- # spacemacs (9)
- # tools-build (17)
hello, how can I make a pattern that says a key must not be in the map?
Maybe by writing a pattern that fails (bottom) if it succeed in matching a key in a map? (and {k (some v)} fail)
I found that just using {:key nil}
seems to work fine
I think in this case will match the same, which is fine for my use case but I can see some other case might wanna know the difference
There is currently not a (clean) way to distinguish between a missing key and a key with a nil
value. 😐
I think something in the direction of what match combinators do would be interesting to have in meander, for the case we are discussing they have the absent
matcher (https://github.com/nubank/matcher-combinators#negative-matchers)
it is possible to make a custom syntax on meander for that?
For interpreted Meander, sure, but for compiled, it’s possible but too much work for the time I am currently making for the project (which has only been on the zeta
branch). The issue boils down to compiled meander resolving key values with get
. We could switch to find
for specific keys but, again, it’s a lot of work.
A workaround be papered over with defsyntax
{& (m/scan [:foo ?x])}