comp.lang.ada
 help / color / mirror / Atom feed
From: jhoward@solar.sky.net (John Howard)
Subject: Re: An Ada9X mimic of C++ friends?
Date: 9 Feb 1995 05:55:21 GMT
Date: 1995-02-09T05:55:21+00:00	[thread overview]
Message-ID: <3hcao9$96b@solar.sky.net> (raw)
In-Reply-To: 3hareb$nq5@lang8.cs.nyu.edu

Cyrille Comar (comar@cs.nyu.edu) wrote:
: needham@newsserver.uconn.edu (Donald M Needham) writes:
: : Is there a construct in Ada9x that circumvents data abstraction
: : similar to a friend in C++?

: You can use the private part of a child unit (or a private child) to
: more or less simulate C++ friends. I say "more or less" because the
: "privacy" in C++ is an attribute of the Class where it is an attribute
: of the package in Ada and Ada package ARE NOT to be compared to C++
: Classes. The right equivalent to C++ classes in Ada95 are private or
: record types (depending on what level of data abstraction you
: want). Those types being "tagged" if you expect to need run-time
: dispatching or type extension.

: Cyrille Comar,                                  E-mail: comar@cs.nyu.edu
: Gnat Project                                    US phone: (212) 998-3489

I come from a background with Borland Pascal dialects and recently I was 
investigating Extended Pascal (ISO 10206:1991) and the latest 
"Object-Oriented Extensions to Pascal" (ANS TR13 or X3J9/93-033).  With 
Borland Pascal and C++ it was required to indicate in the definition of a 
method whether it could be overridden (e.g. virtual) in a descendant class.

Extended Pascal takes the opposite approach.  According to Appendix D.12 
in X3J9/93-033 "Any visible method can be overridden in a descendant class.
A requirement to specify that a method can be overridden thwarts 
specialization and code refinement.  It also requires an omniscient 
designer who anticipates future use; or, it requires the user must have 
access to the underlying code so that it can be changed.  Both of these 
are poor assumptions."

I am new to Ada.
So my question is: does the explicit use of "TAGGED" in Ada95 have the same 
negative consequences as specifying "virtual"?



  reply	other threads:[~1995-02-09  5:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-02-07 13:55 An Ada9X mimic of C++ friends? Donald M Needham
1995-02-07 22:38 ` David Weller
1995-02-08  9:32 ` Michel Gauthier
1995-02-08 16:27 ` Cyrille Comar
1995-02-09  5:55   ` John Howard [this message]
1995-02-09  9:59     ` Stephane Barbey
1995-02-09 21:16     ` Norman H. Cohen
1995-02-10 23:11     ` Cyrille Comar
  -- strict thread matches above, loose matches on Subject: below --
1995-02-07 19:56 Dave Papay M/S 7G32 x2791
replies disabled

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