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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d0452dbe16ac0df4 X-Google-Attributes: gid103376,public From: stt@houdini.camb.inmet.com (Tucker Taft) Subject: Re: ObjectAda vs Gnat -- bugs Date: 1997/05/19 Message-ID: #1/1 X-Deja-AN: 242319655 Sender: news@inmet.camb.inmet.com (USENET news) X-Nntp-Posting-Host: houdini.camb.inmet.com References: <337E5357.7FBA@bix.com> Organization: Intermetrics, Inc. Newsgroups: comp.lang.ada Date: 1997-05-19T00:00:00+00:00 List-Id: 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