comp.lang.ada
 help / color / mirror / Atom feed
From: Mats Weber <Mats.Weber@elca-matrix.ch>
Subject: Re: Design of the Ada95 object system
Date: 1997/11/28
Date: 1997-11-28T00:00:00+00:00	[thread overview]
Message-ID: <347EF0FE.F6B428CD@elca-matrix.ch> (raw)
In-Reply-To: mheaney-ya023680002511970746500001@news.ni.net


Matthew Heaney wrote:

> However, the Ada approach is smarter, because you still need a way to
> organize types, or otherwise there's a huge proliferation of type names in
> global namespace.  Precisely the reason Stroustrup added a namespace.  But
> Ada already has it: the package.  Actually, Ada is better still, because
> you can organize namespaces in a hierarchy.

Smarter ? Well I think that the way operations and types are linked together
(i.e. when they appear in the same package spec) is not that smart. There are
many problems with that approach, like the freezing rules, unwanted links
(e.g. derive Text_IO.Count and you get new versions of New_Line, etc.) and
links that are just not there (e.g. an opeation expressed as a generic is
never derived/inherited).

> >-- An example could look like this:
> >tagged package My_Object_Type is
> >
> >   type Some_Type is new Integer range 0..99;

You probably don't want to declare types inside package types.

> >   procedure Some_Proc (I : in out Some_Type);
> >   XY : Some_Type := 50;
> >   -- Type/subprogram/variable declarations as usual
> >
> >end My_Object_Type;
> 
> This is totally not Ada.  Just banish this from your mind.  If you continue
> to think this way you will never be able to immerse yourself into the Ada
> way of thinking.  In Ada, a module is not a type, and you're not going to
> be doing yourself any favors by wishing it were.

Have you ever used task types ? They make you think just that way.




  reply	other threads:[~1997-11-28  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-11-25  0:00 Design of the Ada95 object system Oliver.Kellogg
1997-11-25  0:00 ` Matthew Heaney
1997-11-28  0:00   ` Mats Weber [this message]
1997-11-28  0:00 ` Mats Weber
replies disabled

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