comp.lang.ada
 help / color / mirror / Atom feed
From: "Vladimir Olensky" <vladimir_olensky@yahoo.com>
Subject: Re: tagged types extensions - language design question
Date: 2000/01/31
Date: 2000-01-31T00:00:00+00:00	[thread overview]
Message-ID: <s9av54lq5io158@corp.supernews.com> (raw)
In-Reply-To: 3892BABB.290D@nospam.com.tj


Andy wrote in message <3892BABB.290D@nospam.com.tj>...

>Although it is good practice to have each child class type in its
>own package, if the intermediate type is just to allow a double
>extension (one public, one private), why not just do so in the one
>package, something like:
>
>-- Root class
>--
>package P1 is
>    type Root is abstract tagged null record;
>    procedure Method (X : in Root) is abstract;
>end P1;
>
>-- Child class
>--
>package P1.P2 is

>
>    -- public extension
>    -- this is abstract so we don't have to override any
>   -- abstract operations defined by the paraent class.
>   --
>    type Intermediates is abstract new P1.Root with record
>        F : Float;  -- etc.
>    end record;
>
>    type Objects is new Intermediates with private;
>
>    procedure Method (X : in Objects);
>
>private
>
>    type Objects is new Intermediates with record
>        I : Integer;  -- etc.
>    end record;
>
>end P1.P2;


Yes, that's fine.

Creating one intermediate type with public attributes
is not a big deal.
It looks strange at first glance that one can not extend both
public and private part in one step but then one get used to
it and it does not seem to be a problem any more.

Regards,
Vladimir Olensky







  reply	other threads:[~2000-01-31  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 ` 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 [this message]
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-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 ` Fraser
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                     ` David Starner
2000-02-12  0:00                       ` blaak
2000-02-15  0:00                         ` Brian Rogoff
2000-02-12  0:00                       ` Pascal Martin
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                           ` 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                           ` root
2000-02-12  0:00                         ` Samuel T. Harris
2000-02-12  0:00                         ` blaak
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               ` 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   ` Vladimir Olensky
2000-02-01  0:00   ` Simon Wright
2000-02-01  0:00   ` Ehud Lamm
replies disabled

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