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: Boris Kolar
Subject: Re: [DotGNU]private inheritence syntax (was Re: C@)
Date: Tue, 13 Aug 2002 22:16:57 +0200

> public class Foo : private PrivateClass1, PublicParent, PublicInterface,
> private PrivateClass2 { /* ... */ };

I like that one too!

If we have private inheritance, why not also "class" inheritance (inheritance 
of type without methods)? True multiple inheritance
would also be nice. It's possible to avoid ambiguity problems if compiler 
forces you to resolve them at compile time.

Like:
  public class Foo: private PrivateClass1, PublicParent1, PublicParent2, class 
SubType1 {
    PublicParent1.Name() = FooName(); // resolve ambuguity
    PublicParent2.Name() = FooName(); // resolve ambuguity
    private String FooName() { ... }
  }

Inheritance by delegation would also be usefull:
  public class Foo: Parent {
    Parent = Bar();
    private Parent Bar() { ... }
  }


And I really like idea of aspect-oriented extensions. Especially usefull is the 
idea of "reverse" inheritance (changing inheritance
of existing class without modifying it's source code).

For example, one might write a perfect class for scanner:
  public class Cannon1234Scanner: Scanner {
    ...
  }
... and then remember, that Scanner is actually a special case of 
ImageAcquisitionDevice:
  public class extension Cannon1234Scanner: ImageAcquisitionDevice {
    ...
  }
or something like that... "extension" keyword indicates that this class 
definition redefines (extends) original Scanner1234Scanner
and does not define a new class.


----- Original Message -----
From: "S11001001" <address@hidden>
To: "DotGNU Mailing List" <address@hidden>
Sent: 13. August 2002 20:50
Subject: [DotGNU]private inheritence syntax (was Re: C@)


> Peter Minten wrote:
> > Peter Minten wrote:
> >
> >
> >>Good ideas, now we just need to figure out how to weave them into the 
> >>language.
> >
> >
> > I've worked it out. The private inheritance can be put in like this:
> >
> > "public class Foo : PublicParent, PublicInterface private PrivateClass"
>
> I counter-suggest something out of C++: have a comma, force every
> private inherited class to have `private' before it, and allow the
> classes in any order. That is to say:
>
> @example
> public class Foo : private PrivateClass1, PublicParent, PublicInterface,
> private PrivateClass2 { /* ... */ };
> @end example
>
> A little more typing, but less confusing, IMHO.
>
> BTW, dotgnu.org works again. It's registered to Bradley Kuhn.
>
> --
> Stephen Compall
> DotGNU `Contributor' -- http://dotgnu.org
>
> Then again, a listener rarely leaves a Stallman speech not knowing
> where the true path to software righteousness lies.
> -- Sam Williams, "Free as in Freedom"
>
> _______________________________________________
> Developers mailing list
> address@hidden
> http://www.dotgnu.org/mailman/listinfo/developers
>



reply via email to

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