3 ms·
It's not a heuristic in D. The grammar was adjusted so having a ; denote an empty statement is not part of the grammar. Hence, if (x); etc. are also rejec
by WalterBright 7y ago
It's not a heuristic in D. The grammar was adjusted so having a ; denote an empty statement is not part of the grammar. Hence,
if (x);
etc. are also rejected. If you actually want an empty statement, { } does the job. Doing it with the grammar is not hackish and it works out quite nicely.
- rdc12 7y agoI'm guessing that was a design goal from day one? How hard has been to maintain that goal, as any slip up will become just as hard to fix as in C, right?
- WalterBright 7y agoD has been more accepting of changes to fix bad design decisions than C has. The ; thing was there since day 1, the rejection of (a < b < c) came later - nobody objected to it.
- rdc12 7y agoIs that a property of the D community being younger (the community itself, rather than the people in the community) and smaller than C and C++ communities. Or is it something more culture based. Any ideas?
- WalterBright 7y agoThat's a great question. It seems to be a property of the D community wanting the language to get better and being willing to accept change. In the olden days (1989) people were more willing to accept change in C, such as value-preserving rather than sign-preserving integer promotion rules, and some improvements to the C preprocessor.