
May 7, 2011
8:18 a.m.
Greg Ewing wrote:
Philip Jenvey wrote:
int x4 = 5_______2; // OK (decimal literal)
Hmmm, that one looks really weird -- maybe it should be disallowed as well?
I don't think we need disallow it merely over an aesthetic judgement (although it does look weird *grins*). There is precedence with separators in collections:
t = (1,,,,2) File "<stdin>", line 1 t = (1,,,,2) ^ SyntaxError: invalid syntax
Like consecutive commas, consecutive underscores are likely to indicate a typo rather than a deliberate decision. So I'm +1 on strictly enforcing a single underscore between digits. -- Steven