accept @pure @nothrow @return attributes

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Thu Jan 29 13:50:29 PST 2015


On 1/29/2015 5:58 AM, Jacob Carlborg wrote:
> On 2015-01-28 23:27, Walter Bright wrote:
>
>> For example, people often realize that the ; statement terminator is
>> redundant, so they propose removing it. In trying it, however, it soon
>> becomes clear that error message clarity, recovery, and the correct
>> identification of the location of the error degrades substantially.
>>
>> So consider:
>>
>>      void func()
>>      safe T = 7;
>>
>> With your proposal, an error isn't discovered until the '=' is found.
>
> A good language design that doesn't require the ; statement terminator would
> recognize "void func()" as a valid statement and implicit add ;. Scan the line,
> if a valid language construct has been seen at the end of the line, insert a ;,
> if not continue to the next line. That works in many languages.


Oh, I know it can be made to work. That wasn't my point, which I shall repeat:

"error message clarity, recovery, and the correct identification of the location 
of the error degrades substantially"

Notice that your comment is still relying on remaining redundancy to try to 
figure out where the ; is supposed to go.


More information about the Digitalmars-d mailing list