comp.lang.ada
 help / color / mirror / Atom feed
From: Tucker Taft <stt@averstar.com>
Subject: Re: tagged types extensions - language design question
Date: 2000/01/28
Date: 2000-01-28T21:19:08+00:00	[thread overview]
Message-ID: <389207CC.C16D80E8@averstar.com> (raw)
In-Reply-To: s90mu0hg7q538@corp.supernews.com

Vladimir Olensky wrote:
> 
> The question is :
> 
>    Why in Ada it is  not allowed to extend both public
>  and private part of the tagged type at one step ( using
>  kind of syntax as in the following example ):
> ...
> 
>     It would be interesting to know what were
> the reasons not to allow to have BOTH a record
> extension AND a private extension at the same time.

When designing a language there are hundreds of tradeoffs.
We chose a "building block" approach to Ada 95.  Rather than
trying to anticipate all uses, and make every feature have several
bells and whistles, we tried to provide features that can be
combined in an infinite number of ways to solve whatever problems
are encountered.

In general, if you start comparing languages, you are working in
the "solution" space rather than the "problem" space, and you will
generally be frustrated if you try to find an exact match in the
solution space.  The more important issue is whether you can solve
the problems of interest efficiently and effectively using the
features of the language you are evaluating.  

Personally, I would be more interested in real-world examples
of problems that in some sense require an abstraction whose
implementation is partly private and partly visible.  

In some of the problems I have seen, a natural solution 
in Ada is to implement the abstraction with a fully public 
record type, but make certain components of the
record be of a private type.  More often, I have found it better to implement
the abstraction using a fully private type, and then add set/get operations
as needed to expose certain components where appropriate.  Quite often
I end up discovering that either the "set" or "get" ends up requiring
more than a simple assignment or load from the corresponding component
of the underlying record, and I congratulate myself for having the "foresight"
(yeah, right) to use a fully-private type in the first place.

I suppose the ultimate answer is that the need for a partly private/
partly visible abstraction was thought to be rare enough that it
was felt to be better to keep the set of language primitives simpler, and
allow the programmer to combine them as needed to handle the more
complicated problems.  As usual, your mileage may vary... 

> Regards,
> Vladimir Olensky

-- 
-Tucker Taft   stt@averstar.com   http://www.averstar.com/~stt/
Technical Director, Distributed IT Solutions  (www.averstar.com/tools)
AverStar (formerly Intermetrics, Inc.)   Burlington, MA  USA




  parent reply	other threads:[~2000-01-28  0:00 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-01-27  0:00 tagged types extensions - language design question Vladimir Olensky
2000-01-27  0:00 ` Fraser
2000-01-27  0:00 ` Laurent Guerby
2000-01-28  0:00   ` Vladimir Olensky
2000-01-28  0:00     ` Andy
2000-01-28  0:00       ` Vladimir Olensky
2000-01-29  0:00         ` Andy
2000-01-31  0:00           ` Vladimir Olensky
2000-01-27  0:00 ` Matthew Heaney
2000-01-27  0:00   ` Charles Hixson
2000-01-28  0:00   ` Vladimir Olensky
2000-01-28  0:00     ` Matthew Heaney
2000-01-28  0:00       ` Charles Hixson
2000-01-28  0:00         ` Matthew Heaney
2000-02-01  0:00           ` Charles Hixson
2000-02-01  0:00             ` Matthew Heaney
2000-01-29  0:00       ` Vladimir Olensky
2000-01-29  0:00         ` Matthew Heaney
2000-01-31  0:00           ` Vladimir Olensky
2000-01-31  0:00             ` Matthew Heaney
2000-01-31  0:00               ` Vladimir Olensky
2000-01-29  0:00         ` Matthew Heaney
2000-01-28  0:00 ` Tucker Taft [this message]
2000-01-31  0:00   ` Vladimir Olensky
2000-02-01  0:00   ` Charles Hixson
2000-02-01  0:00     ` Matthew Heaney
2000-02-01  0:00       ` Brian Rogoff
2000-02-03  0:00         ` scripting/extension language for Ada (was : Re: tagged types extensions) root
2000-02-03  0:00           ` Brian Rogoff
2000-02-04  0:00             ` Ray Blaak
2000-02-04  0:00               ` Stanley R. Allen
2000-02-04  0:00                 ` Samuel T. Harris
2000-02-05  0:00                   ` Lionel Draghi
2000-02-05  0:00                     ` Samuel T. Harris
2000-02-06  0:00                       ` Bryce Bardin
2000-02-08  0:00                         ` Samuel T. Harris
2000-02-06  0:00                       ` Lionel Draghi
2000-02-05  0:00                 ` Ray Blaak
2000-02-05  0:00                 ` Lionel Draghi
2000-02-04  0:00               ` Robert A Duff
2000-02-05  0:00                 ` Ehud Lamm
2000-02-05  0:00                 ` blaak
2000-02-05  0:00                   ` Brian Rogoff
2000-02-09  0:00                   ` Robert A Duff
2000-02-09  0:00                     ` Ted Dennison
2000-02-10  0:00                       ` Samuel T. Harris
2000-02-10  0:00                 ` Pascal Martin
2000-02-10  0:00                   ` Ray Blaak
2000-02-11  0:00                     ` David Starner
2000-02-12  0:00                       ` Pascal Martin
2000-02-12  0:00                       ` blaak
2000-02-15  0:00                         ` Brian Rogoff
2000-02-11  0:00                     ` scripting/extension language for Ada (we have an opportunity here) Tarjei T. Jensen
2000-02-11  0:00                       ` Robert I. Eachus
2000-02-12  0:00                         ` Tarjei Tj�stheim Jensen
2000-02-12  0:00                           ` root
2000-02-12  0:00                           ` Samuel T. Harris
2000-02-14  0:00                             ` Robert A Duff
2000-02-15  0:00                               ` Samuel T. Harris
2000-02-16  0:00                                 ` Robert A Duff
2000-02-16  0:00                                   ` Samuel T. Harris
2000-02-16  0:00                                     ` Robert A Duff
2000-02-17  0:00                                       ` Samuel T. Harris
2000-02-12  0:00                         ` Pascal Martin
2000-02-13  0:00                           ` Robert I. Eachus
2000-02-16  0:00                             ` scripting/extension ... [off topic] Nick Roberts
2000-02-16  0:00                               ` Ray Blaak
2000-02-12  0:00                         ` scripting/extension language for Ada (we have an opportunity here) blaak
2000-02-12  0:00                         ` Samuel T. Harris
2000-02-14  0:00                     ` scripting/extension language for Ada (was : Re: tagged types extensions) Robert A Duff
2000-02-05  0:00             ` scripting/extension language for Ada (was : Re: tagged typesextensions) Lionel Draghi
2000-02-05  0:00           ` scripting/extension language for Ada (was : Re: tagged types extensions) Ehud Lamm
2000-02-06  0:00             ` Lionel Draghi
2000-02-06  0:00               ` scripting/extension language for Ada Terry Westley
2000-02-06  0:00               ` scripting/extension language for Ada (was : Re: tagged types extensions) Ehud Lamm
2000-02-09  0:00               ` Robert A Duff
2000-01-31  0:00 ` tagged types extensions - language design question Mark Lundquist
2000-02-01  0:00   ` Ehud Lamm
2000-02-01  0:00   ` Simon Wright
2000-02-01  0:00   ` Vladimir Olensky
replies disabled

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