Class-Interface compatibility

Scott S. McCoy tag at cpan.org
Sun Mar 30 15:20:36 PDT 2008


It is kind of curious why interface typed identifiers don't implicitly
cast to Object, and you must explicitly cast.

But regardless of the reason, adopting a convention (and a bad one at
that) such as prefixing interfaces with "I" probably shouldn't be done
at the language level.  And even more, D already has avoided creating
any kind of special types (you can throw Object, for instance, and it's
not a derivative of Exception) so far as I can tell...why start now?

Cheers,
    Scott S. McCoy

On Sun, 2008-03-30 at 23:25 +0200, Frank Benoit wrote:

> COM is the only reason I am aware of, why interfaces are not implicit 
> compatible to to object.Object. But COM is a very special case which 
> probably can get a special solution?
> 
> How about making /IUnknown/ a special interface without this 
> compatibility and have all interfaces, not derived from IUnknown be 
> compatible to Object?
> 
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20080330/70a99023/attachment.html>


More information about the Digitalmars-d mailing list