This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-09-02
Channels
- # announcements (2)
- # babashka (21)
- # beginners (80)
- # bristol-clojurians (1)
- # calva (1)
- # cider (4)
- # clara (2)
- # clj-kondo (5)
- # cljs-dev (41)
- # clojure (8)
- # clojure-dev (2)
- # clojure-europe (28)
- # clojure-italy (11)
- # clojure-nl (4)
- # clojure-spec (13)
- # clojure-sweden (1)
- # clojure-uk (11)
- # clojuredesign-podcast (5)
- # clojurescript (5)
- # code-reviews (4)
- # cursive (25)
- # data-science (5)
- # datomic (25)
- # duct (15)
- # emacs (6)
- # fulcro (13)
- # graalvm (1)
- # graphql (5)
- # helix (2)
- # jobs (3)
- # jobs-discuss (4)
- # luminus (1)
- # malli (13)
- # meander (3)
- # off-topic (16)
- # pathom (2)
- # pedestal (1)
- # re-frame (5)
- # ring-swagger (3)
- # spacemacs (4)
- # sql (16)
- # tools-deps (1)
- # tree-sitter (8)
- # vrac (2)
- # xtdb (16)
- # yada (2)
Does anyone know why integrant’s composite-keyword
function appends a gensym’d value to the end of the composite key?
I know these return values are memoized, but I was thinking about using them as a stable id across JVM restarts, though obviously can’t because of this.
Obviously it’s easy to generate a unique composite myself; so not a big deal, just curious what the reasoning was.
Isn’t it a unique unambiguous value without the gensym
though?
You'd have to take all the keywords, stringify them, and then create a new keyword out of that, in order to make it unique
The only thing would be that:
[:foo.bar/baz]
and
[:foo/bar.baz]
Would both result in the same key (in the function's current form, without gensym)
Ah true
I think technically speaking you could always create duplicate keys without gensym. But you could make it very difficult
Yeah I think the problem is that ig/loadnamespaces
allows :foo.bar.baz
and :foo.bar/baz
to resolve to the same thing
That's one problem, the other is that when creating a new composite keyword, it joins the name and namespace with a .
yeah but that later one is easily solved by changing the implementation of composite-keyword
well I say easily solved… I guess there is a small issue that most characters are usable in a keyword
though actually you could leverage using unreadable characters there e.g. even (keyword "foo bar")
would work (though not recommending that one)
actually ignore all that.