comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Extending a third party tagged type while adding finalization
Date: Thu, 7 Dec 2017 09:36:30 +0100
Date: 2017-12-07T09:36:30+01:00	[thread overview]
Message-ID: <p0auie$h5h$1@gioia.aioe.org> (raw)
In-Reply-To: p0a4k8$lap$1@franka.jacob-sparre.dk

On 07/12/2017 02:13, Randy Brukardt wrote:
> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
> news:p07343$1tst$1@gioia.aioe.org...
>> On 2017-12-05 22:09, Randy Brukardt wrote:
> ...
>> I don't know your definition of ADT, but mine is in agreement with
>> Wikipedia:
>>
>> "In computer science, an abstract data type (ADT) is a mathematical model
>> for data types, where a data type is defined by its behavior (semantics)
>> from the point of view of a user of the data, specifically in terms of
>> possible values, possible operations on data of this type, and the
>> behavior of these operations. This contrasts with data structures, which
>> are concrete representations of data, and are the point of view of an
>> implementer, not a user."
> 
> Mathematical model? By that definition, I'll never write an ADT.

Of course you do. There is no way any computer implementation to have no 
mathematical model. Unless you are working with a jigsaw on your 
computer box ...

Programming is not science, not even much an applied science. It has no 
truths of its own.

> The above
> is much too complex. It could be simplified a lot:
> 
> An ADT is a data type (from the perspective of a client of a type) defined
> solely by the operations defined for that data type.

1. That does not apply to Ada since it has named type matching. 
Therefore you can have two different types with identical operations.

2. You cannot do anything with a type otherwise than through its 
operations. So the definition would be useless without splitting 
operations into "operations operations" and not "quite operations", 
which you apparently trying to do.

> For Ada, this means that an ADT is a private type (possibly tagged) with
> (usually explicit) primitive operations, and that there are no end-runs on
> those primitive operations. All other uses of the ADT are built out of those
> primitives.

Why does it follow?

1. Private type means that parts of the representation is hidden. Your 
definition is not related to that.

2. Primitiveness of an operation is not related either.

> If a type is not private, it cannot be an ADT, as it provides an unlimited
> number of other operations that are not described explicitly.

How primitiveness changes that? I still can define new subprograms 
taking and returning values of the type regardless. Adding new 
operations does not alter the semantics of ADT. Overriding could.

> With the
> Wikipedia definition above, every Ada data type is an ADT, since every type
> can be described this way (every operation on a numeric type is described by
> the Ada Standard, after all, and a client can use nothing else). That's a
> completely useless definition.

ADT is the semantics it implements. You first have the semantics 
(mathematical model of the problem space) and then an implementation of.

Non-ADT is ad-hoc semantics deduced from a given representation. You 
take 'int' from the compiler and then try to figure out if it can be 
useful for you.

That is the difference.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

  reply	other threads:[~2017-12-07  8:36 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-22 12:43 Extending a third party tagged type while adding finalization Jere
2017-11-22 16:42 ` AdaMagica
2017-11-26 17:33   ` Jere
2017-11-26 18:15     ` Dmitry A. Kazakov
2017-11-26 19:31       ` Jere
2017-11-27  9:46     ` AdaMagica
2017-11-27 12:56       ` Jere
2017-11-27 15:00         ` AdaMagica
2017-11-27 16:38           ` Jere
2017-11-27 18:37             ` AdaMagica
2017-11-27 19:53               ` Jere
2017-11-28 11:48                 ` AdaMagica
2017-12-03  2:22                   ` Jere
2017-12-03 21:53               ` Robert Eachus
2017-12-04  7:58                 ` Dmitry A. Kazakov
2017-12-04 14:59                   ` Robert Eachus
2017-12-04 15:39                     ` Dmitry A. Kazakov
2017-11-27 18:10     ` Shark8
2017-11-27 19:56       ` Jere
2017-11-28  1:55       ` Randy Brukardt
2017-12-03  2:47         ` Jere
2017-12-03  9:29           ` Dmitry A. Kazakov
2017-12-03 15:10             ` AdaMagica
2017-12-03 16:39               ` Dmitry A. Kazakov
2017-12-03 19:34             ` AdaMagica
2017-12-03 19:41               ` Dmitry A. Kazakov
2017-12-04 12:38                 ` AdaMagica
2017-12-04 13:19                   ` AdaMagica
2017-12-04 13:55                     ` Dmitry A. Kazakov
2017-12-04 15:44                       ` AdaMagica
2017-12-04 16:19                         ` Dmitry A. Kazakov
2017-12-04 20:54           ` Randy Brukardt
2017-12-04 21:02             ` Dmitry A. Kazakov
2017-12-05 21:09               ` Randy Brukardt
2017-12-05 21:29                 ` Dmitry A. Kazakov
2017-12-07  1:13                   ` Randy Brukardt
2017-12-07  8:36                     ` Dmitry A. Kazakov [this message]
2017-12-07 23:22                       ` Randy Brukardt
2017-12-08  9:30                         ` Dmitry A. Kazakov
2017-12-09  0:17                           ` Randy Brukardt
2017-12-11  9:03                             ` Dmitry A. Kazakov
2017-12-11 22:42                               ` Randy Brukardt
2017-12-12 16:11                                 ` AdaMagica
2017-12-12 20:08                               ` G. B.
2017-12-12 20:32                                 ` Dmitry A. Kazakov
replies disabled

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