From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c7d1d12d1859ad7f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-02-08 21:55:21 PST Path: nntp.gmd.de!newsserver.jvnc.net!nntpserver.pppl.gov!princeton!udel!gatech!howland.reston.ans.net!news.sprintlink.net!solar.sky.net!solar.sky.net!jhoward From: jhoward@solar.sky.net (John Howard) Newsgroups: comp.lang.ada Subject: Re: An Ada9X mimic of C++ friends? Date: 9 Feb 1995 05:55:21 GMT Organization: SkyNET Corporation Message-ID: <3hcao9$96b@solar.sky.net> References: <3h7u4p$8cp@bellboy.ucc.uconn.edu> <3hareb$nq5@lang8.cs.nyu.edu> NNTP-Posting-Host: solar.sky.net X-Newsreader: TIN [version 1.2 PL2] Date: 1995-02-09T05:55:21+00:00 List-Id: 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"?