comp.lang.ada
 help / color / mirror / Atom feed
From: "Matthew Heaney" <matthew_heaney@acm.org>
Subject: Re: tagged types extensions - language design question
Date: 2000/01/28
Date: 2000-01-28T00:00:00+00:00	[thread overview]
Message-ID: <Ctjk4.4704$%87.155081@newsread1.prod.itd.earthlink.net> (raw)
In-Reply-To: 3891B5B3.7430F96B@earthlink.net

In article <3891B5B3.7430F96B@earthlink.net> , Charles Hixson 
<charleshixsn@earthlink.net>  wrote:

>> But you'd have the "additional package" in other OOP languages too.  In
>> another language you'd have to declare two "classes," which means two
>> modules.  Same as Ada.  (Although I think you can nest classes in C++,
>> right?)
>>
>
> My understanding of Eiffel (not the greatest!) is that it would handle THIS
> PROBLEM gracefully in one step.  My problem with it is the lack of control
> over direct (random access) I/O.

I don't understand why everything has to be "done in one step."  In
Ada95, you have to declare an intermediate (abstract) type, in order to
declare some attributes as public.  It's really not that big a deal.

If you follow that guideline that a type hierarchy should be declared in
a package hierarchy, then there is no problem.  This is exactly what
you'd have to do in other OOP languages (because different classes are
each declared in their own module).

There seem to be two issues:

1) The relationship between types and modules.

2) The syntax of public versus private attributes.


In issue #1, Ada95 gives you *more* than you get in other OOP languages,
and that's the ability to declare different types in the same module.
You can't do that in many other languages, so there's no limitation in
Ada95.

In issue #2, Ada95 does require you to declare an intermediate type.
Yes, that's "extra" work, but how much are we really talking about?
It's only one extra declaration, comprising a mere 2 SLOCS:

package P.C is

  type NT_Public is abstract new T with record
    Public_Attribute : Public_Attribute_Type;
  end record;

  type NT is new NT_Public with private;
...
end P.C;

Why is everyone getting heartburn about having to declare type
NT_Public?  In C++, I'd have to use the keyword "public:" before listing
the public members, so there's syntactic overhead in that language too.







  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 ` 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 [this message]
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-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-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-28  0:00 ` Tucker Taft
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                 ` Lionel Draghi
2000-02-05  0:00                 ` Ray Blaak
2000-02-04  0:00               ` Robert A Duff
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-05  0:00                 ` Ehud Lamm
2000-02-10  0:00                 ` Pascal Martin
2000-02-10  0:00                   ` Ray Blaak
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                         ` 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) 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                         ` blaak
2000-02-12  0:00                         ` Samuel T. Harris
2000-02-11  0:00                     ` scripting/extension language for Ada (was : Re: tagged types extensions) David Starner
2000-02-12  0:00                       ` Pascal Martin
2000-02-12  0:00                       ` blaak
2000-02-15  0:00                         ` Brian Rogoff
2000-02-14  0:00                     ` 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               ` Ehud Lamm
2000-02-06  0:00               ` scripting/extension language for Ada Terry Westley
2000-02-09  0:00               ` scripting/extension language for Ada (was : Re: tagged types extensions) 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   ` Vladimir Olensky
2000-02-01  0: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