comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Generic Collection
Date: Tue, 15 May 2007 19:27:31 -0500
Date: 2007-05-15T19:27:31-05:00	[thread overview]
Message-ID: <f2dj1p$791$1@jacob-sparre.dk> (raw)
In-Reply-To: m2tzuh0yz9.fsf@mac.com

"Simon Wright" <simon.j.wright@mac.com> wrote in message
news:m2tzuh0yz9.fsf@mac.com...
....
> If your implementation guidelines say that everything should be tagged
> I'd have to ask why? (I don't believe that programming-language
> inheritance is necessarily a good way of implementing application area
> specialization/generalization).

Not to speak for others, but there are a lot of reasons:

(1) Most complex types need to be controlled in order to properly manage
their memory. Making them visibly tagged thus has no overhead.

(2) Maximum flexibility: allowing future clients the ability to extend the
type without modifying the base type likely reduces future maintence (can't
break something that you don't change). I don't care much for or about
inheritance, but extension is a big win.

(3) Tagged types "work right" in Ada: "=" composes properly, user-defined
operations are used in generics (not true for untagged types, where the
predefined ones "reimerge"), parameter passing is consistent;
'Access can be used in the implementation without forcing users to declare
everything in sight aliased, you can use prefix calls on the objects, and
there may be more that I've forgotten.

Note that none of these have anything to do with classwide programming,
dynamic dispatching, or inheritance, or in fact the tag itself. (3) was an
important enough issue that we actually considered adding an "aliased" type
to the Amendment which would provide those benefits without requiring a tag.
But in the end it was considered to be not enough of an improvement.

Conclusion: (almost) all new ADTs in Ada should be visibly tagged and
possibly visibly derived from Controlled.

                              Randy.





  parent reply	other threads:[~2007-05-16  0:27 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-08 19:29 Generic Collection andrew
2007-05-08 21:00 ` Georg Bauhaus
2007-05-08 21:59   ` andrew
2007-05-09 14:51     ` andrew
2007-05-09 16:12       ` Georg Bauhaus
2007-05-09 18:54         ` andrew
2007-05-10 19:31           ` Simon Wright
2007-05-10 22:48             ` andrew
2007-05-11  8:10               ` Georg Bauhaus
2007-05-11 20:41                 ` andrew
2007-05-11 21:28                   ` Georg Bauhaus
2007-05-11 21:55                     ` andrew
2007-05-12  7:18               ` Simon Wright
2007-05-12  7:52                 ` Dmitry A. Kazakov
2007-05-13 11:00                   ` Simon Wright
2007-05-13 12:11                     ` Dmitry A. Kazakov
2007-05-16  0:27                     ` Randy Brukardt [this message]
2007-05-16  6:05                       ` Simon Wright
2007-05-16  7:17                         ` Untagged types don't work right - was: " Grein, Christoph (Fa. ESG)
2007-05-16 13:27                       ` Benjamin Place
2007-05-14 17:09                 ` andrew
2007-05-14 20:00                   ` Simon Wright
replies disabled

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