Rather D1 then D2

Jonathan Marler johnnymarler at gmail.com
Sat Sep 22 22:27:52 UTC 2018


On Saturday, 22 September 2018 at 20:53:02 UTC, krzaq wrote:
> On Saturday, 22 September 2018 at 20:40:14 UTC, Jonathan Marler 
> wrote:
>> On Saturday, 22 September 2018 at 19:04:41 UTC, Henrik wrote:
>>> [...]
>>
>> That works for types but wouldn't work for keywords. Keywords 
>> have special meaning in the lexical stage and you can't 
>> extend/change the grammar of the language via an alias or 
>> typedef.  You could do something like this with a preprocessor 
>> but then you run into all sorts of other problems (i.e. 
>> #define safe @safe).
>>
>> If you come up with other ideas then feel free to share.  No 
>> one likes the current state but no one has come up with a good 
>> solution yet.
>
> C++ added contextual keywords, like `override` and `final`. If 
> this can be done in C++, surely D is easier to parse?

https://wiki.dlang.org/Language_Designs_Explained#Why_don.27t_we_create_a_special_rule_in_the_syntax_to_handle_non-keyword_function_attributes_without_an_.27.40.27_character.3F


More information about the Digitalmars-d mailing list