Self-host: Qualify symbols and namespaced keywords in spec macros
Description
There are currently a few symbols and namespaced keywords in the cljs.spec macros namespace that either need to be qualified for proper operation, or should be.
The symbols fall into the category of calls to runtime functions in the cljs.spec namespace, and need qualification in order to avoid the $macros suffix. These comprise with-gen and gen.
In terms of keywords, an example that causes a failure is ::kvs->map in keys*: It resolves to :cljs.spec$macros/kvs->map which doesn't match the :cljs.spec/kvs->map spec registered near the bottom of the cljs.spec runtime namespace.
An example that doesn't cause an outright failure, but arguably inhibits its proper use by client code is ::nil and :red in the nilable macro. Ideally these would resolve to :cljs.spec/nil and :cljs.spec/pred so that client code can rely on these namespaced symbols identifying the branches.
Given the nilable example, you could argue that the intent is that all namespaced keywords in the cljs.spec macro namespace that employ :: resolve in :cljs.spec so that they can be used not simply as unique identifiers (the intent is not simply to avoid potential collisions), but so that they can be used as stable identifiers.
The set of keywords that should be qualified comprises: ::kind-form, ::kfn, ::conform-all, ::kvs->map, ::nil, and :red
There are currently a few symbols and namespaced keywords in the
cljs.spec
macros namespace that either need to be qualified for proper operation, or should be.The symbols fall into the category of calls to runtime functions in the
cljs.spec
namespace, and need qualification in order to avoid the$macros
suffix. These comprisewith-gen
andgen
.In terms of keywords, an example that causes a failure is
::kvs->map
inkeys*
: It resolves to:cljs.spec$macros/kvs->map
which doesn't match the:cljs.spec/kvs->map
spec registered near the bottom of thecljs.spec
runtime namespace.An example that doesn't cause an outright failure, but arguably inhibits its proper use by client code is
::nil
and:
red
in thenilable
macro. Ideally these would resolve to:cljs.spec/nil
and:cljs.spec/pred
so that client code can rely on these namespaced symbols identifying the branches.Given the
nilable
example, you could argue that the intent is that all namespaced keywords in thecljs.spec
macro namespace that employ::
resolve in:cljs.spec
so that they can be used not simply as unique identifiers (the intent is not simply to avoid potential collisions), but so that they can be used as stable identifiers.The set of keywords that should be qualified comprises:
::kind-form
,::kfn
,::conform-all
,::kvs->map
,::nil
, and:
red