Examples Wanted: Usages of "body" as a Symbol Name

Jonathan Marler via Digitalmars-d digitalmars-d at puremagic.com
Wed Oct 5 12:13:00 PDT 2016


On Wednesday, 5 October 2016 at 19:02:02 UTC, Basile B. wrote:
> On Wednesday, 5 October 2016 at 18:41:02 UTC, Jacob Carlborg 
> wrote:
>> On 2016-10-05 19:14, Matthias Klumpp wrote:
>>
>>> Agreed - I have exactly the same problem with "version", 
>>> which is also
>>> really common for, well, to hold a version number of a 
>>> component. Body
>>> is annoying too.
>>>
>>> But, can keywords actually sanely be removed from the 
>>> language without
>>> breaking the world?
>>
>> In Ruby most keywords are not reserved words. a.`def`()
>
> D context free grammar allow fast highlighting. I understand 
> that people who write scripts think that it won't change 
> anything...but it's not the reality. D is a system programming 
> language, people who use D can deal with code base > 60 Kloc. 
> And we don't want to see such a change because you can't use 
> "body" in your student project.

Yes the fact that D is context free is a very nice benefit and I 
can pretty much guarantee that D maintainers will never allow 
changing the syntax to break this.

However, I believe a context-free grammar could support 
"contextual keywords".  Note that the word "contextual" here is a 
bit misleading.  For someone who really wanted to remove body as 
a keyword, I encourage them to try to modify the syntax and see 
if they can maintain the "context-free" grammar and without over 
complicating the syntax.  I'm not sure if it's possible, but it 
might be.  Anyone up for the challenge?



More information about the Digitalmars-d mailing list