comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <robert_dewar@my-deja.com>
Subject: Re: Function Calls by Address
Date: 1999/09/06
Date: 1999-09-06T00:00:00+00:00	[thread overview]
Message-ID: <7r1cro$9pf$1@nnrp1.deja.com> (raw)
In-Reply-To: 37D41767.CEB186F4@magic.fr

In article <37D41767.CEB186F4@magic.fr>,
  Francois Godme <fgodme@magic.fr> wrote:
> Is it wrong to think that Machine_State_Operations gathered
methods that
> apply on a Machine_State, as its own name may imply? Is it
wrong to
> think that an abstract tagged type could fill the same
purpose, if it
> was allowed in this context?


To make my previous reply a little clearer.

The issue here is one of modular structure, I do not see
what tagged types have to do with it. So let me address
the two issues separately:

1. Tagged types, why on earth would you use such a heavy
approach here. There is only one instance of machine operations
for a given port of GNAT, so using dispatching to get to these
routines is entirely gratuitous, as is type extension.

There is no point in using tagged types and polymorphism when
a perfectly straightforward abstract data type will do just
as well. For some reason, this simply fact seems to get
forgotten these days.

2. The discussion here is about modular structure. We have two
choices, either of which could be used with or without tagged
types.

We can either use a subunit, or a private child package. I
see the subunit as far neater, because it encapsulates the
functionality just to the package body, whereas the child is
a child of the spec. The child is thus at the same level as
the spec, and this seems to be a violation of abstraction,
not to mention that it results in the gratuitous addition
of an extra separately compiled unit (the useless package
spec).

SO, once again, I think that ??emstop is a very nice example
of how subunits can be used in a neat way, with minimal
syntactic overhead, to achieve exactly what is wanted.

Note that this is a case where the argument is based on
encapsulation alone. That was deliberate. You can of course
make far more convincing examples where the inheritance of
the surrouding environment is critical (ah, but then I forgot
you don't like nested environments :-)

Indeed subunits and nested procedures are quite related from
a structural point of view, in both cases, one of the powerful
features is the implicit inheritance of the surrounding
environment.

Robert Dewar


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.




  reply	other threads:[~1999-09-06  0:00 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-08-30  0:00 Function Calls by Address Craig Jameson
1999-08-30  0:00 ` Marin David Condic
1999-08-30  0:00   ` Marin David Condic
1999-08-30  0:00     ` Larry Kilgallen
1999-08-30  0:00   ` Robert Dewar
1999-08-30  0:00 ` Robert Dewar
1999-08-30  0:00 ` Robert Dewar
1999-08-31  0:00   ` Martin Gangkofer
1999-08-31  0:00 ` Matthew Heaney
1999-08-31  0:00 ` David Kristola
1999-09-01  0:00 ` Simon Wright
1999-09-02  0:00 ` Francois Godme
1999-09-03  0:00   ` Robert Dewar
1999-09-03  0:00     ` Francois Godme
1999-09-03  0:00       ` David C. Hoos, Sr.
1999-09-04  0:00         ` Robert Dewar
1999-09-05  0:00           ` Francois Godme
1999-09-06  0:00             ` Robert Dewar
1999-09-06  0:00               ` Francois Godme
1999-09-06  0:00                 ` Robert Dewar [this message]
1999-09-06  0:00                   ` Bob Collins
1999-09-07  0:00                     ` Pascal Obry
1999-09-06  0:00                 ` Robert Dewar
1999-09-07  0:00                 ` Pascal Obry
1999-09-07  0:00                   ` Francois Godme
1999-09-08  0:00                   ` Francois Godme
1999-09-03  0:00       ` Marin David Condic
1999-09-14  0:00         ` Robert I. Eachus
     [not found]           ` <wcc3dwgb7ii.fsf@world.std.com>
     [not found]             ` <37E81079.CC2566D9@mitre.org>
1999-09-22  0:00               ` Robert A Duff
1999-09-22  0:00                 ` Robert I. Eachus
1999-09-23  0:00                 ` Robert Dewar
1999-09-23  0:00                   ` Robert A Duff
1999-09-03  0:00       ` Robert Dewar
1999-09-03  0:00         ` Ted Dennison
1999-09-04  0:00           ` Jean-Pierre Rosen
1999-09-05  0:00             ` Matthew Heaney
1999-09-05  0:00             ` Ehud Lamm
1999-09-04  0:00         ` Brian Rogoff
1999-09-05  0:00           ` Robert Dewar
1999-09-05  0:00           ` Robert Dewar
1999-09-05  0:00           ` Robert Dewar
1999-09-03  0:00       ` Simon Wright
1999-09-04  0:00       ` Mario Klebsch
1999-09-05  0:00         ` Robert Dewar
1999-09-06  0:00           ` Francois Godme
1999-09-05  0:00             ` Brian Rogoff
1999-09-06  0:00             ` Robert Dewar
1999-09-08  0:00               ` Georg Bauhaus
1999-09-05  0:00       ` Geoff Bull
1999-09-07  0:00       ` Michael F. Yoder
replies disabled

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