"body" keyword is unnecessary

piotrek starpit at tlen.pl
Thu Mar 24 10:46:33 PDT 2011


On Fri, 25 Mar 2011 00:50:56 +0800, KennyTM~ wrote:

> On Mar 24, 11 22:25, piotrek wrote:
>> On Thu, 24 Mar 2011 21:37:12 +0800, KennyTM~ wrote:
>>
>>> On Mar 24, 11 19:00, sclytrack wrote:
>>>> == Quote from piotrek (starpit at tlen.pl)'s article
>>>>> On Wed, 23 Mar 2011 23:17:32 +0100, Alvaro wrote:
>>>>>> D already has a long list of keywords, reserved words can't be used
>>>>>> as identifiers, which can be annoying. "body" in particular is a
>>>>>> common noun that programmers would gladly use as a variable name in
>>>>>> physics simulation, astronomy, mechanics, games, health, etc. I
>>>>>> think "body" can be removed from D with no harm, and with the
>>>>>> benefit of allowing the name as identifier.
>>>>> yes, please
>>>>> body is also a html tag
>>>>> Cheers
>>>>> Piotrek
>>>>
>>>> Copied the following line from the Vala (=mostly reference counted
>>>> language) web page.
>>>>
>>>> "It is possible to use a reserved keyword as identifier name by
>>>> prefixing it with the @ character. This character is not part of the
>>>> name. For example, you can name a method foreach by writing @foreach,
>>>> even though this is a reserved Vala keyword."
>>>>
>>>> My body is hungry and starving.
>>>>
>>>>
>>>>
>>> How is this better than _body or body_?
>>
>> I think "@" is a little bit nicer, but it doesn't change the situation
>> at all . body (if possible) shouldn't be a keyword. Can anyone from the
>> steering group state his opinion? :)
>>
>> Cheers,
>> Piotrek
> 
> I agree body shouldn't be a keyword.
> 
> The @body solution doesn't work in D because:
> ...

Yes I know. I was only referring to how it looks.
I'm allergic to the underscore char in programming languages ;)
"better" in my previous post was like:
2 cents are "better" than 1 cent and I can have 1 million dollars.
So why would I want "@body" if I can have "body".
@body was just useless noise.

Cheers,
Piotrek


More information about the Digitalmars-d mailing list