Semicolon?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Thu Apr 1 02:40:40 UTC 2021


On 3/31/21 10:13 PM, Walter Bright wrote:
> On 3/31/2021 2:59 PM, deadalnix wrote:
>> On Wednesday, 31 March 2021 at 21:51:07 UTC, Arun wrote:
>>> Just curious. Does the compiler need semicolon anymore? Are there 
>>> corner cases that don't work without semicolon?
>>
>> They aren't strictly needed most of the time, but they do make things 
>> much clearer, especially when you have a syntax error.
> 
> Yup. They're a form of redundancy like a parity bit is.

There are a few cases that would be ambiguous. Not sure how realistic:

auto a = b;
*c;

Without semicolons the semantics would be different.


More information about the Digitalmars-d mailing list