Semicolons: mostly unnecessary?

bearophile bearophileHUGS at lycos.com
Thu Oct 22 01:36:01 PDT 2009


Don Wrote:
> Please don't post crazy stuff like this. This proposal would break every 
> line of D code ever written.

If semicolons become optional, the old code that uses them will keep working, because adding an extra semicolon isn't an error.

Broken lines like:
foo(x,
y);
a = [1, 2,
3];
c = [1:2,
3:4];
d = {0,
1};
too will keep working because the things inside parentheses [] () (and {} when it's a static struct initializer) don't need an explicit line continuation sign.

Some lines will need editing because they will need the line continuation syntax. I think this may be acceptable.

Bye,
bearophile



More information about the Digitalmars-d mailing list