Julia: deprecate multiple-underscore-only variable names

Created on 27 Jul 2017  路  2Comments  路  Source: JuliaLang/julia

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".)

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.

All 2 comments

+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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iamed2 picture iamed2  路  3Comments

tkoolen picture tkoolen  路  3Comments

Keno picture Keno  路  3Comments

helgee picture helgee  路  3Comments

omus picture omus  路  3Comments