DIP 1003 Formal Review

MysticZach via Digitalmars-d digitalmars-d at puremagic.com
Wed May 17 10:06:40 PDT 2017


On Wednesday, 17 May 2017 at 09:57:41 UTC, Basile B. wrote:
> On Wednesday, 17 May 2017 at 09:53:49 UTC, MysticZach wrote:
>> Option 4) Keep `body`, but make it both contextual *and* 
>> optional. It becomes usable as an identifier, and those who 
>> think it's unnecessary are appeased. The downside is that 
>> different programmers will include it or not, based on 
>> arbitrary preferences.
>
> The problem with this option is the IDEs. D syntax so far 
> doesn't require parsing to highlight, i.e you have a token and 
> you know what is it directly, and this without looking at the 
> previous tokens (which is basically what parsing does, detect 
> token patterns).

I don't feel like it's much of a problem:

1. I suspect a simple matching of the three tokens '}', 'body', 
'{' would detect it most of the time.

2. Without that, remove `body` from your highlighter's list of 
keywords. When used as a keyword, it's very conspicuous anyway. 
Code won't lose much readability with just this one word unlit.

3. If `body` were optional, probably a lot of people wouldn't be 
using it to begin with. I suspect that Jonathan and I are not 
alone in thinking that it's not just useless, it's annoying. 
Thus, only code that uses it would have this problem.



More information about the Digitalmars-d mailing list