When D is not nice

Frank Benoit keinfarbton at googlemail.com
Sun Jul 6 15:08:07 PDT 2008


bearophile schrieb:
> Frank Benoit:
>> Instead i was trying to show a flaw in the language design.
> 
> I think automatic casting of types is a source of troubles. Some times I'd like to remove from D some automatic integer/unsigned casts that D inherits from C.
> 
> Bye,
> bearophile

I think class/interface compatibility is not going to introduce trouble.
With the exception of COM, every interface IS an Object.

The missing compatibility makes the basic object functionality missing. 
That makes trouble with .toString as shown, with container that want to 
use opCmp/opEquals or functions that just want an Object of any type:

void store(Object o);

but i need a cast for interface:
store( cast(Object)a );

Yuck!





More information about the Digitalmars-d mailing list