This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-06-14
Channels
- # beginners (183)
- # boot (6)
- # cider (106)
- # cljs-dev (17)
- # cljsjs (2)
- # cljsrn (2)
- # clojure (56)
- # clojure-italy (14)
- # clojure-nl (39)
- # clojure-spec (49)
- # clojure-uk (138)
- # clojurescript (197)
- # core-logic (37)
- # cursive (22)
- # datascript (5)
- # datomic (29)
- # devcards (18)
- # emacs (1)
- # events (8)
- # figwheel (1)
- # fulcro (59)
- # lein-figwheel (1)
- # leiningen (1)
- # off-topic (54)
- # onyx (3)
- # pedestal (1)
- # portkey (4)
- # re-frame (18)
- # reagent (5)
- # reitit (43)
- # ring (6)
- # ring-swagger (26)
- # shadow-cljs (42)
- # spacemacs (8)
- # specter (12)
- # sql (3)
- # tools-deps (21)
- # vim (18)
Is it possible to define a lookup relation for map keys, similar to (geto k m v)
? I saw that maps unify only over values, so this might be hard.
Okay,
(defn geto [m k v]
(featurec m {k v}))
Seems to do the trick, at least when k really is a keyword. I don't understand why it's limited to values thoughif k is a key in m, and v is a value in m, and q unifies with m, what values does q have?
you need some more complicated datastructure that understands unification and can do things like merge keys that are unified
Hm, so it would be possible, but only if I converted my maps to that richer datastructure before?
Hm yeah, it looks like this would do it, if it were implemented, which it doesn't seem to be 😄