comp.lang.ada
 help / color / mirror / Atom feed
From: koehnema@enuxsa.eas.asu.edu (Harry Koehnemann)
Subject: Re: Type extension questions
Date: Mon, 27 Mar 1995 17:29:07 GMT
Date: 1995-03-27T17:29:07+00:00	[thread overview]
Message-ID: <D640KK.63D@ennews.eas.asu.edu> (raw)
In-Reply-To: 3l0frd$b9t@lang8.cs.nyu.edu

In article <3l0frd$b9t@lang8.cs.nyu.edu> comar@cs.nyu.edu (Cyrille Comar) writes:
>Don't try to be too close to C++, this doesn't fit Ada's
>model. "Private inheritance" is meaningless in Ada since "Private" is
>a caracteristic of packages and inheritance a characteristic of types
>but you can still do something very close from what you want :

Well, yes and no.  What I really want to do is restrict the interface
to a type.  It might help to see an example.  Let's pretend we have 2
abstract data types, where one is an extension of the other:

    class List {
	public:  Set (...) { ...}
	private: ...;
    };

    class Stack : private List {
	public:  Push() { ...}
	private: ...;
    };

It is not appropriate for a Stack to invoke Set.  One could argue that
Stack has-a List instead of Stack is-a list (I think Tucker Taft made
this argument earlier).  Bottom line - I guess there is no way to
perform private inheritance, as shown in the above example, in Ada95,
which was my question.  Thanks for the input.

BTW - I am by no means saying Ada95 should have included such a
feature (in fact, I am not a believer in restricting interfaces and
think that it clutters a design).  I'm just getting my Ada95 facts
straight.



  parent reply	other threads:[~1995-03-27 17:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-03-22  0:25 Type extension questions Harry Koehnemann
1995-03-22 12:01 ` Robb Nebbe
1995-03-23 22:05   ` Harry Koehnemann
1995-03-25  6:59     ` Cyrille Comar
1995-03-25  7:13     ` Cyrille Comar
1995-03-27  0:00       ` Norman H. Cohen
1995-03-30  0:00         ` Cyrille Comar
1995-03-27 17:29       ` Harry Koehnemann [this message]
1995-03-27 20:26         ` Robert I. Eachus
1995-03-29  0:00           ` Harry Koehnemann
1995-03-27 20:37         ` Kennel
1995-03-23 22:03 ` Tucker Taft
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox