Confusing function name suffixes in error messages


Some core function names are reported in error messages with an odd munging suffix.

For example, when passing the wrong number of arguments to inc, assoc, and dissoc, each error message reports the function name differently:

From the user's point of view, this behaviour is unmotivated and confusing. Perhaps such names should be further demunged and printed without the suffix.


Clojure 1.10.0-beta4


Alex Miller
November 4, 2018, 6:35 AM

The first one here is an inlined function and happens during compilation, so is a little different than the others. Because it's inlined, it's not spec-able. The name parts there are generated within the compiler as well. This one might be fixable based on the regularity of the name construction, although I don't see it as a particularly high priority.

The latter two actually will be a bit different once we apply CLJ-2420:

Changes here are actually eliding all the internal frames and reporting the top user frame now (here, it happens to be in the REPL invocation, but if it was in a user namespace, you'd see that instead).

I guess in both cases, the numbers you're seeing are a standard technique used throughout Clojure so the question might be whether it's possible to address this in a systematic way. Functions don't inherently carry their unmunged name right now, so demunging from class name is never going to be a foolproof mechanism.

Worth thinking about how to do this better, but not something I expect to look at soon.




David Bürgin





Affects versions