Identifier Naming

Thomas Kuehne thomas-dloop at kuehne.cn
Sun Mar 12 03:30:33 PST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sean Kelly schrieb am 2006-03-11:
> Thomas Kuehne wrote:
>> 
>> I just love C#:
>> 
>>> class NamingOnTheRocks{
>>>    static int @if(int @while){
>>>        return @while * @while;
>>>    }
>>>
>>>    public static int Main(string[] args){
>>>        int @return;
>>>        int @static = 3, @switch = 8, @break = 2, @case = 3, @true = 0;
>>>
>>>        if(@if(@switch + @break) * @case != @true){
>>>            @return = @static;
>>>        }else{
>>>            @return = @break / @static;
>>>        }
>>>
>>>        return @return * 2;
>>>    }
>>> }
>> 
>> No joke - this is valid C# !
>
> What a wonderful language :-p  What does the '@' represent?

@ indicates an identifier following: "int @x;" and "int x;" are
identical. As a consequence you can write "int @some_keyword;" while
you can't write "int some_keyword;".

Thomas

-----BEGIN PGP SIGNATURE-----

iD8DBQFEFBQL3w+/yD4P9tIRAiMGAJ9smOA/+OyRyvG8DjcEHuANzONPlwCfbt7s
efcS8sgqUuY1RAEtFMqIFdw=
=eSt9
-----END PGP SIGNATURE-----



More information about the Digitalmars-d-announce mailing list