comp.lang.ada
 help / color / mirror / Atom feed
From: bobduff@dsd.camb.inmet.com (Bob Duff)
Subject: Re: SOLVED! Decoupled Mutual Recursion Challenger
Date: Wed, 19 Oct 1994 01:01:45 GMT
Date: 1994-10-19T01:01:45+00:00	[thread overview]
Message-ID: <CxwAuy.1CL@inmet.camb.inmet.com> (raw)
In-Reply-To: 1994Oct18.221751.15457@swlvx2.msd.ray.com

In article <1994Oct18.221751.15457@swlvx2.msd.ray.com>,
John Volan <jgv@swl.msd.ray.com> wrote:
>However, making it this general was just a gratuitous freebie.  I
>threw it in because I couldn't see any reason not to -- but now I do
>see the reason.  At any rate, there is some room to back off: The
>original intent was to be able to "opaquely" store pointers
>designating what would (eventually) be tagged record types -- most
>likely class-wide types, and most likely only *definite* tagged record
>types.  So it would not hurt things very much if wee restricted the
>contract to only support pointers designating definite, class-wide
>tagged record types:

You probably have a higher probability of being portable to more
compilers if you use general access types.  Say "access all" instead of
just "access".  The reason is that the latter is pool-specific, and the
compiler very well might take advantage of specific properties of that
storage pool.  If you use general access types (access all), then the
compiler is less likely to play games on you.

>        type Pointer is access Object'Class;

Better say:

    type Pointer is access all Object'Class;
                           ^^^

>>Another implementation I've heard about (from Rational, I think?),
>>creates a separate storage pool for every access type, and uses various
>>virtual memory tricks to make that efficient.  Access types end up being
>>represented in various numbers of bits, I believe.
>
>So, depending on what pools the clients store their tagged types in,
>even the above scheme might not turn out to be portable.

If you use general access types, you will probably defeat such
cleverness in the compiler.  (No guarantees, though.)

>    generic
>      type Object (<>) is limited private;
>    package Address_To_Access_Conversion is
>      type Object_Pointer is access all Object;
>      ...
>
>In other words, this package provides a *new* access type into which
>address values can be converted.  It's *not* providing the capability
>to convert some *arbitrary* access type into addresses.

Explicit type conversions between general access types are allowed in
certain circumstances.  Check out the RM for details.

>This is a bit of a restriction, but not too unreasonable.  In fact,
>there may be other reasons for introducing a root Universal class
>anyway.  Other object-oriented "infrastructures" often do something
>similar.

Yes.  In Smalltalk and some other languages, there's a class that's the
mother of all classes.

- Bob
-- 
Bob Duff                                bobduff@inmet.com
Oak Tree Software, Inc.
Ada 9X Mapping/Revision Team (Intermetrics, Inc.)



  reply	other threads:[~1994-10-19  1:01 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-10-12 22:49 SOLVED! Decoupled Mutual Recursion Challenger John Volan
1994-10-17 15:48 ` John Volan
1994-10-17 17:55   ` Bob Duff
1994-10-17 20:52     ` John Volan
1994-10-17 22:10       ` Bob Duff
1994-10-18 22:17         ` John Volan
1994-10-19  1:01           ` Bob Duff [this message]
1994-10-19  4:45             ` Jay Martin
1994-10-19 14:38               ` Mark A Biggar
     [not found]                 ` <38fi4r$l81@oahu.cs.ucla.edu>
1994-10-24 11:49                   ` Mutual Recursion Challenge Robert I. Eachus
1994-10-24 20:32                     ` John Volan
1994-10-26 11:42                       ` Generic association example (was Re: Mutual Recursion Challenge) Robert I. Eachus
1994-10-26 23:21                         ` John Volan
1994-10-27 10:53                           ` Robert I. Eachus
1994-10-31 17:34                             ` John Volan
1994-10-27 14:37                           ` Mark A Biggar
1994-10-24 17:42                   ` SOLVED! Decoupled Mutual Recursion Challenger John Volan
1994-10-24 22:37                     ` Jay Martin
1994-10-25  5:47                       ` Matt Kennel
1994-10-25 10:04                         ` David Emery
1994-10-25 16:43                         ` John Volan
1994-10-27  4:25                           ` Rob Heyes
1994-10-28  9:03                             ` Mutual Recursion (was Re: SOLVED! Decoupled Mutual Recursion Challenger) Robert I. Eachus
1994-10-28 15:04                             ` SOLVED! Decoupled Mutual Recursion Challenger Robb Nebbe
1994-10-25 15:54                       ` John Volan
1994-10-26  1:24                         ` Bob Duff
1994-10-28  4:28                         ` Jay Martin
1994-10-28 10:52                           ` Robert I. Eachus
1994-10-28 18:46                             ` Jay Martin
1994-11-02 14:56                               ` Robert I. Eachus
1994-10-29  0:38                           ` Bob Duff
1994-10-29  7:26                             ` Jay Martin
1994-10-29 11:59                             ` Richard Kenner
1994-10-31 13:17                               ` Robert Dewar
1994-10-31 14:13                               ` gcc distribution (was: SOLVED! Decoupled Mutual Recursion Challenger) Norman H. Cohen
1994-11-02 14:14                                 ` Richard Kenner
1994-11-04 23:56                                   ` Michael Feldman
1994-10-31 18:44                           ` SOLVED! Decoupled Mutual Recursion Challenger John Volan
1994-10-20 11:25               ` Robb Nebbe
1994-10-20 19:19                 ` John Volan
1994-10-26  0:07                 ` Mark S. Hathaway
1994-10-26 18:48                 ` gamache
1994-10-27  2:15                   ` John Volan
     [not found]           ` <CxwGJF.FwB@ois.com>
1994-10-19 16:35             ` John Volan
1994-10-17 22:54   ` Cyrille Comar
replies disabled

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