A few simple syntactic proposals

Yigal Chripun yigal100 at gmail.com
Fri Apr 18 01:56:00 PDT 2008


Robert Fraser wrote:
> Christopher Wright wrote:
>> Robert Fraser wrote:
>>> 2. Allow interfaces that are not sub-interfaces of IUnknown to be
>>> explicitly "delete"d.
>>
>> Just make all interface variables implicitly typed Object as well. Or
>> make an IObject interface that Object and all interfaces inherit
>> from, then make delete take an IObject as well.
>>
>> Then you can have IUnknown not inherit from IObject if you want.
>
> Yup, that's how it should be implemented. Unless you're suggesting
> make users rewrite all their code so that their interfaces extend
> IObject, in which case I object. (that was kind of lame)
Also, to add to Robert's post - This also applies to classes:
if you define the IObject interface all classes would inherit from it
and would have to provide implementation for it instead of just
inheriting the implementation from Object.
the best solution for this IMO is Christopher's first idea - make all
interfaces subtypes of object.
-- Yigal



More information about the Digitalmars-d mailing list