We already deprecate _
as a variable name. Hopefully, we can eventually use it as a placeholder for discarded lhs values (#9343) and/or for a compact anonymous-function/currying syntax (e.g. _.a
for x -> x.a
: #554, #5571, #22710).
As I discussed with @Keno today, it might be good to additionally deprecate all variable names consisting only of underscores, e.g. __
or ___
. It is weird to disallow _
but allow __
, and multiple underscores might be useful for something later.
(One possible use: in an implicit currying syntax, make f(g(_,y))
denote f(x -> g(x,y))
and f(g(__,x)
denote x -> f(g(x,y))
, i.e. _
is "tight" and __
is "loose".)
+1 to deprecation, whether we want this to mean anything is a different matter.
Just to be conservative, we should deprecate these. If they're deprecated we can always change our minds but we can't go in the other direction.
Most helpful comment
Just to be conservative, we should deprecate these. If they're deprecated we can always change our minds but we can't go in the other direction.