comp.lang.ada
 help / color / mirror / Atom feed
From: "Pat Rogers" <progers@NOclasswideSPAM.com>
Subject: Re: Why both "with" and "use"?
Date: 1999/02/14
Date: 1999-02-14T00:00:00+00:00	[thread overview]
Message-ID: <7a7fiv$i5$1@remarQ.com> (raw)
In-Reply-To: collins-1402991015000001@cx832447-a.nwptn1.va.home.com

Bob Collins wrote in message ...
>In article <7a6jho$nkv$1@remarQ.com>, "Pat Rogers"
><progers@NOclasswideSPAM.com> wrote:
>
>> Yes, the package isn't part of the type itself, but let's go back
for
>> a moment to the definition I gave of an ADT: "a set of legal
>> operations (the "primitives") and legal values, and little else."
It
>> is the "little else" that packages provide, and IMHO and ADT
without
>> that aspect is not an ADT.  We're in agreement overall, of course,
but
>> I think it is important to stress that, in addition to the
demarcation
>> of the primitives, as you've said above, the encapsulation of the
>> type's representation is an essential aspect of an ADT.  Without
>> packages, we have no encapsulation, no information hiding.
>
>In the Guttag-Horning-Liskov formulations of the algebraic
>specifications of ADTs, errors were important values. The
>Ada package allows errors in ADTs very naturally, as exceptions
>declared inside the package. Every stack ADT need an Empty_Stack
>exception declaration for completeness as an ADT and possibly
>a Stack_Overflow exception declaration as a practical convenience.
>
>These are the kinds of things that are more than the "little else"
>mentioned above. Also, when the TOI (type of interest) in each of
>two type algebras is a supporting type in the other, it is
>programmatically convenient to include both ADTs in the same
>package. In this thread, we've already seen an example of a structure
>and its iterator in the same package.


I fail to see how the above argues against my point that encapsulation
(provided by the package) is a necessary aspect of an ADT.  No one
would argue that error conditions are not part of the ADT interface.
My point is that the operations available due to the type's
representation are available unless the package prevents it, and such
operations are *not* part of the interface.

---
Pat Rogers                          Training & Development in:
http://www.classwide.com    Deadline Schedulability Analysis
progers@classwide.com         Software Fault Tolerance
(281)648-3165                       Real-Time/OO Languages

>
>--
>Bob Collins  <mailto:collins@cs.wm.edu>  <http://ratbert.cs.wm.edu>






  reply	other threads:[~1999-02-14  0:00 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-02-13  0:00 Why both "with" and "use"? Mike Silva
1999-02-13  0:00 ` Corey Minyard
1999-02-13  0:00   ` Matthew Heaney
1999-02-13  0:00     ` Tom Moran
1999-02-14  0:00       ` Matthew Heaney
1999-02-13  0:00     ` bill
1999-02-14  0:00       ` dewar
1999-02-14  0:00       ` Matthew Heaney
1999-02-14  0:00       ` dewar
1999-02-16  0:00     ` Samuel Mize
1999-02-17  0:00       ` dennison
1999-02-17  0:00         ` Samuel Mize
1999-02-17  0:00         ` Nick Roberts
1999-02-17  0:00       ` Jean-Pierre Rosen
1999-02-17  0:00       ` Matthew Heaney
1999-02-17  0:00       ` Jean-Pierre Rosen
1999-02-18  0:00         ` dennison
1999-02-18  0:00           ` robert_dewar
1999-02-19  0:00             ` dennison
1999-02-19  0:00             ` Robert I. Eachus
1999-02-19  0:00               ` Brian Hanson
1999-02-19  0:00                 ` robert_dewar
1999-02-19  0:00               ` robert_dewar
1999-02-23  0:00                 ` Robert I. Eachus
1999-02-19  0:00             ` bourguet
1999-02-19  0:00               ` robert_dewar
1999-02-19  0:00           ` Matthew Heaney
1999-02-19  0:00             ` dennison
1999-02-19  0:00               ` robert_dewar
1999-02-19  0:00                 ` dennison
1999-02-19  0:00                   ` robert_dewar
1999-02-19  0:00                 ` Ada multiple string personalities. why so many? mike
1999-02-19  0:00                   ` robert_dewar
1999-02-19  0:00                   ` Tom Moran
1999-02-19  0:00                     ` Mike Silva
1999-02-22  0:00                       ` Brian Hanson
1999-02-18  0:00         ` Why both "with" and "use"? robert_dewar
1999-02-18  0:00           ` Jean-Pierre Rosen
1999-02-18  0:00             ` robert_dewar
1999-02-19  0:00               ` Jean-Pierre Rosen
1999-02-13  0:00   ` mike
1999-02-13  0:00 ` Pat Rogers
1999-02-13  0:00   ` bill
1999-02-13  0:00     ` Pat Rogers
1999-02-13  0:00       ` Matthew Heaney
1999-02-13  0:00         ` bill
1999-02-14  0:00         ` Pat Rogers
1999-02-14  0:00           ` Bob Collins
1999-02-14  0:00             ` Pat Rogers [this message]
1999-02-16  0:00         ` Samuel Mize
1999-02-13  0:00     ` Matthew Heaney
1999-02-15  0:00     ` Jean-Pierre Rosen
1999-02-15  0:00       ` Ed Falis
1999-02-16  0:00         ` Jean-Pierre Rosen
1999-02-15  0:00 ` Jean-Pierre Rosen
replies disabled

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