is questions
Kramer
Kramer_member at pathlink.com
Thu Mar 16 13:02:25 PST 2006
Comments inline.
In article <dvci0j$1lj9$1 at digitaldaemon.com>, Lucas Goss says...
>
>pragma wrote:
>> Obi-Wan: This is not the idiom you're looking for. :)
>
>Hahaha...
>
>> D uses the cast() operator to accomplish runtime type checking. The 'is'
>> operator is something else entirely (value/reference equality).
>
>Doh... well thanks! Don't know how I missed that, I was even looking at
>cast too. I must be getting my languages mixed up. In addition, maybe
>the documentation is also confusing. I looked at "is" and it says:
>
>IsExpressions are evaluated at compile time and are used for checking
>for valid types, comparing types for equivalence, determining if one
>type can be implicitly converted to another, and deducing the subtypes
>of a type.
>
>I guess I always think of a class as a custom type. Is that not the
>correct way to think of it? Of course I still prefer this syntax:
>
>if(x is int)
This is under the Identity Expressions section in
http://www.digitalmars.com/d/expression.html
>
>instead of:
>
>if( is(x : int) )
And this is under the IsExpression section in
http://www.digitalmars.com/d/expression.html
This is what I'm assuming you found out. I'm glad you brought this up though as
it forced me to look over that documentation again.
-Kramer
More information about the Digitalmars-d
mailing list