"body" keyword is unnecessary

bearophile bearophileHUGS at lycos.com
Thu Mar 24 04:12:09 PDT 2011


sclytrack:

> 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."

In C# there is the same thing:

>The prefix "@" enables the use of keywords as identifiers, which is useful when interfacing with other programming languages. The character @ is not actually part of the identifier, so the identifier might be seen in other languages as a normal identifier, without the prefix. An identifier with an @ prefix is called a verbatim identifier. Use of the @ prefix for identifiers that are not keywords is permitted, but strongly discouraged as a matter of style.<

http://msdn.microsoft.com/en-us/library/aa664670%28v=vs.71%29.aspx

Bye,
bearophile


More information about the Digitalmars-d mailing list