duct

2020-09-02T07:27:58.002700Z

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.

kwrooijen 2020-09-02T07:32:48.004300Z

I think it's just an easy solution to make it unique

2020-09-02T07:36:09.005700Z

Isn’t it a unique unambiguous value without the gensym though?

kwrooijen 2020-09-02T07:37:30.006300Z

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

kwrooijen 2020-09-02T07:37:55.006600Z

Ah right but the parts are also part of the new key

kwrooijen 2020-09-02T07:39:23.008Z

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)

2020-09-02T07:39:50.008500Z

Ah true

kwrooijen 2020-09-02T07:39:59.008800Z

But that could be fixed

kwrooijen 2020-09-02T07:40:17.009200Z

(I think)

kwrooijen 2020-09-02T07:40:48.009900Z

I think technically speaking you could always create duplicate keys without gensym. But you could make it very difficult

2020-09-02T07:41:36.010600Z

Yeah I think the problem is that ig/loadnamespaces allows :foo.bar.baz and :foo.bar/baz to resolve to the same thing

kwrooijen 2020-09-02T07:42:06.011100Z

That's one problem, the other is that when creating a new composite keyword, it joins the name and namespace with a .

2020-09-02T07:42:48.011700Z

yeah but that later one is easily solved by changing the implementation of composite-keyword

2020-09-02T07:44:08.012500Z

well I say easily solved… I guess there is a small issue that most characters are usable in a keyword

2020-09-02T07:45:55.013600Z

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.