On a particular namespace I am working on I am beginning to run out of function names. Is there a way to get a warning like the one I get if I override a symbol from another namespace if I reuse a symbol which is already bound to a function in the same namespace?
Share
If this is enough of a problem that you’d be willing to replace a (set of) core macro(s), you could try this approach:
Then any attempt to redefine an existing Var with
defnwill fail:You could similarly replace
defmacro; in that case you would have to callclojure.core/defmacrowhen defining your own variant.Plain, unadorned
defis a special form and receives magic treatment from the compiler, so you could still overwrite existing Vars with it. If you would like to guard against name clashes on that flank too, you could switch to something likedefvar(used to be available inclojure.contrib.def) with a similar custom assert.