comp.lang.ada
 help / color / mirror / Atom feed
From: bobduff@world.std.com (Robert A Duff)
Subject: Re: Choice of OO primitives in Ada95
Date: 1996/02/19
Date: 1996-02-19T00:00:00+00:00	[thread overview]
Message-ID: <Dn1EMM.8z2@world.std.com> (raw)
In-Reply-To: Dn0FqH.8Cw@assip.csasyd.oz

In article <Dn0FqH.8Cw@assip.csasyd.oz>,
Don Harrison <donh@syd.csa.com.au> wrote:
>package X is
>  type MARRIAGE is tagged ...
>  type PERSON is tagged ...
>  type UNIVERSITY is tagged ...
>  type GOVERNMENT is tagged ...
>  type ELECTORATE is tagged ...
>  type ADDRESS is tagged ...
>
>  procedure Enrol (Student : in out PERSON; Uni : in out UNIVERSITY);
>  procedure Award_Grant (Polies : in out GOVERNMENT; Uni : in out UNIVERSITY);
>  procedure Make_Gerrymander (Polies : in out GOVERNMENT; Elect : in out ELECTORATE);
>  function Office_Address (Elect : in ELECTORATE) return ADDRESS;
>
>end X;
>
>Each abstraction is related to the previous one but isn't necessarily related
>to any other. As I understand it, the language rules dictate that each of these 
>abstractions must be in the same package.

No, they don't have to be in the same package (and as you say, probably
should not be).  Could you explain what you mean -- why do you think
that all of the above types have to be in the same package?

(By the way, the above code is illegal, by 3.9.2(12).)

>I can't make any comment on C++ as I'm unfamiliar with it (must be the only
>one in the world). The Eiffel equivalent of static members are probably 'once'
>attributes which may optionally be exported (visible or private).

No, static members in C++ are not quite the same thing as Eiffel's
'once' attributes.  A static member is just a function that is inside
the class for visibility/encapsulation purposes, but isn't attached to
any particular object.  In other words, there's no "self" or "this" when
you call a static member.  A once attribute is a function that gets
executed just once, and the result gets saved -- when you call it again,
you get the saved value.  In Ada, you would just use a constant for that
purpose, in most cases.

>... This issue
>is language war flame bait and I don't intend to defend the pure OO position
>here :-)

Once attributes are flame bait?  Not sure why anybody would get too hot
about that issue.  OK, if you say so.

- Bob




  parent reply	other threads:[~1996-02-19  0:00 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <DMqHqF.9F1.0.-s@inmet.camb.inmet.com>
     [not found] ` <DMu9yw.5ts@assip.csasyd.oz>
     [not found]   ` <4g2f8v$15lc@watnews1.watson.ibm.com>
1996-02-19  0:00     ` Choice of OO primitives in Ada95 Don Harrison
1996-02-19  0:00       ` Norman H. Cohen
1996-02-19  0:00       ` Robert A Duff [this message]
1996-02-20  0:00         ` Don Harrison
1996-02-20  0:00           ` Jon S Anthony
1996-02-22  0:00             ` Real OO (was Choice of OO primitives in Ada95) Don Harrison
1996-02-22  0:00               ` Jon S Anthony
1996-02-22  0:00               ` Robert Dewar
1996-02-23  0:00                 ` Gene Ouye
1996-02-26  0:00                   ` James O'Connor
1996-02-26  0:00                     ` Gene Ouye
1996-02-24  0:00               ` Valery Croizier
1996-02-24  0:00               ` Robert A Duff
1996-02-26  0:00                 ` Don Harrison
1996-02-26  0:00                 ` Matthew B. Kennel
1996-02-26  0:00               ` So called Real OO (was blah blah blah...) Jon S Anthony
1996-02-20  0:00           ` Choice of OO primitives in Ada95 Ray Toal
1996-02-21  0:00             ` Don Harrison
1996-02-23  0:00               ` Robert A Duff
1996-02-22  0:00             ` Bernd Holzmueller
1996-02-23  0:00               ` Robert A Duff
1996-02-23  0:00           ` Robert A Duff
1996-02-21  0:00       ` Robert I. Eachus
1996-02-21  0:00     ` John DiCamillo
1996-02-22  0:00       ` Don Harrison
1996-02-24  0:00         ` Robert A Duff
     [not found] <4fmrhk$7k3@erinews.ericsson.se>
1996-02-19  0:00 ` Richard A. O'Keefe
replies disabled

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