is questions

Lucas Goss lgoss007 at gmail.com
Thu Mar 16 10:24:36 PST 2006


2)

1) I can't seem to get "is" to work with interfaces, what's the syntax? 
Attached is the code I want to work. I just want to be able to tell if a 
class is of a certain type of interface.

2) Does anyone else find the "is" expression a little convoluted? Is 
there any reason "is" can't be used like:

if(x is int)
   ... do some int stuff

if(x is IStream)
   ... do some stream stuff

I know it can be used that way for checking null, which I couldn't find 
the documentation for using "is" with null (it would be nice if the 
keywords in the lexical section had links to documentation on the 
keyword), but why is it used two different ways? Is there a reason it 
can't be used with types as in above? Maybe I just haven't thought this 
out enough, but the above seems much easier.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.d
Type: text/x-dsrc
Size: 359 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20060316/a724533f/attachment.d>


More information about the Digitalmars-d mailing list