dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [DotGNU]private inheritence syntax (was Re: C@)


From: Peter Minten
Subject: Re: [DotGNU]private inheritence syntax (was Re: C@)
Date: Sat, 17 Aug 2002 10:36:49 -0400

Boris Kolar wrote:

> The drawback of this is that it may replace too many words, not just what's 
intended.

How, only the part between '%%'s is replaced, if the programmer messes this up
it his/her own fault.

> Putting syntax issues besides, the idea was to allow programmer to modify
> behaviour (including inheritance) of existing class, without modifying it's
> source. For example, there may be two libraries for scanner driver, each
> with it's own definition of "Scanner":
>
> library A:
>   public class Fujistu1234Scanner: AbstractScanner {
>     ...
>   }
>
> library B:
>   public class Cannon1234Scanner: Scanner {
>     ...
>   }
>
> ... where AbstractScanner and Scanner are similar, but not derived from the
> same class. Now, as a developer using both libraries, i'd like to make
> these libraries compatible with each other. If i modify one of the          
> libraries, i'll have to do all modifications again when new version of the 
> library is released, so i'd like to change the class without source 
> modification.

I apparently misread your message, sorry. The idea of using the 'extension'
keyword is quite good. Let's say we take your syntax and use the following
rules: an extension class behaves just like a child class except that it has 
the same name as it's parent and replaces it for the block where it is 
visible. This means that if an extension is put into namespace Foo.Bar it 
will only work for a class in Foo if Foo.Bar is referenced (using 'using').

Greetings,

Peter



reply via email to

[Prev in Thread] Current Thread [Next in Thread]