comp.lang.ada
 help / color / mirror / Atom feed
From: stt@houdini.camb.inmet.com (Tucker Taft)
Subject: Re: ObjectAda vs Gnat -- bugs
Date: 1997/05/19
Date: 1997-05-19T00:00:00+00:00	[thread overview]
Message-ID: <EAEMqA.31A.0.-s@inmet.camb.inmet.com> (raw)
In-Reply-To: 337E5357.7FBA@bix.com


Tom Moran (tmoran@bix.com) wrote:

: I'm a little confused by this renaming of function return values.  If T
: is a limited type and F is a function returning T, then I understand one
: can:
:   X:T renames F(...);
: and one cannot
:   X:T := F(...);
: Is that correct?

Correct.

: If T is not limited, then what are the differences between
:   X : T renames F(...);
:   Y : T := F(...);

In the first case, X inherits the "constant"ness of the object
being renamed, which in this case, means that X is a constant.
In the second case, we have a new object, and since you left
off the word "constant" it is not a constant.

If you had written "Y : constant T := F(...);" then they would
be almost indistinguishable (though you wouldn't be able
to apply representation clauses to the rename, since you haven't
really declared a new object).

-Tucker Taft   stt@inmet.com   http://www.inmet.com/~stt/
Intermetrics, Inc.  Burlington, MA  USA

P.S. For what its worth, enumeration literals really are treated
as functions in our Ada 95 front end symbol table.  It is just 
their "body" which is a bit funny -- it is intrinsic and all calls
are "expanded" inline. -TT




  parent reply	other threads:[~1997-05-19  0:00 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-05-15  0:00 ObjectAda vs Gnat -- bugs granger
1997-05-15  0:00 ` Samuel A. Mize
1997-05-15  0:00 ` Samuel A. Mize
1997-05-15  0:00 ` Robert Dewar
1997-05-16  0:00   ` David L Brown
1997-05-16  0:00     ` Robert Dewar
1997-05-17  0:00       ` Tom Moran
1997-05-18  0:00         ` Jon S Anthony
1997-05-19  0:00         ` Tucker Taft [this message]
1997-05-19  0:00       ` Tom Moran
1997-05-15  0:00 ` Stephen Leake
1997-05-16  0:00   ` Tucker Taft
1997-05-16  0:00     ` Jon S Anthony
1997-05-16  0:00       ` Tom Moran
1997-05-16  0:00       ` Robert Dewar
1997-05-17  0:00         ` Jon S Anthony
1997-05-16  0:00   ` Jon S Anthony
1997-05-16  0:00 ` Robert A Duff
1997-05-16  0:00   ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
1997-05-16  0:00 Keith Thompson
1997-05-16  0:00 ` Robert A Duff
1997-05-16  0:00   ` Robert Dewar
1997-05-18  0:00     ` Nick Roberts
1997-05-19  0:00       ` Robert Dewar
1997-05-20  0:00         ` Nick Roberts
1997-05-21  0:00           ` Robert Dewar
1997-05-23  0:00   ` Stephen Leake
1997-05-24  0:00     ` Robert A Duff
1997-05-28  0:00       ` Stephen Leake
1997-05-30  0:00         ` Samuel Mize
1997-05-30  0:00         ` Robert A Duff
1997-05-30  0:00           ` Matthew Heaney
1997-05-31  0:00             ` Robert A Duff
1997-05-19  0:00 tmoran
1997-05-19  0:00 ` Jon S Anthony
1997-05-20  0:00   ` Nick Roberts
1997-05-25  0:00     ` Tom Moran
1997-05-20  0:00   ` Jeff Carter
1997-05-30  0:00 John Walker
replies disabled

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