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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c319c681003d3e4c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-09-15 15:27:25 PST Newsgroups: comp.lang.ada Path: bga.com!news.sprintlink.net!redstone.interpath.net!ddsw1!news.kei.com!MathWorks.Com!europa.eng.gtefsd.com!emory!pirates!news-feed-1.peachnet.edu!paperboy.wellfleet.com!noc.near.net!inmet!spock!stt From: stt@spock.camb.inmet.com (Tucker Taft) Subject: Re: Static in 9X Message-ID: Sender: news@inmet.camb.inmet.com Organization: Intermetrics, Inc. References: <940914130023_73672.2025_DHR31-2@compuserve.com> Date: Thu, 15 Sep 1994 15:05:43 GMT Date: 1994-09-15T15:05:43+00:00 List-Id: In article <940914130023_73672.2025_DHR31-2@compuserve.com>, Ken Garlington <73672.2025@COMPUSERVE.COM> wrote: >I'm trying to work a problem with my Ada vendor, and time is short, so I would >appreciate any help I can get in the next day or so. Part of my problem is >understanding the definition of "static" in the 9XRM 4.9. Which (if any) of the >following are static, and under what conditions/assumptions? (Assume that >exceptions are not a factor.) > >1. A constant composite value, with static initial values, e.g. > > type R is record > X : INTEGER; > Y : INTEGER; > end record; > > REC : constant R := (1,2); -- static? No. >2. Components of a record/elements of an array, e.g. > > V : constant INTEGER := REC.X; -- static? No. >3. A user-written function, e.g. > > function Z return INTEGER is begin return 0; end; -- static? No. >4. Type conversions that require manipulation of the form of the data; e.g. > > X : constant FLOAT := 0.0; > Y : constant LONG_FLOAT := LONG_FLOAT(X); -- static? Yes, this is one of the changes in Ada 9X (see below). >5. UNCHECKED_CONVERSIONs? No. The interesting changes in type conversions from Ada 83 can be summarized as follows: 1) Type conversions are static if the target is a static scalar subtype and the operand is static; 2) Short circuit operations are static if the operands are both (potentially) static; 3) Membership tests are static if the operand is static and the range or subtype is static; 4) String literals and concatenations of static operands returning a string type are static (but 'value and 'image are never static). 5) The bounds/length of an array object or array subtype are static if the object/subtype is statically constrained. This is enumerated in the AARM-4.9(41.a .. 47.a);5.0. If you don't want to wade your way through the AARM for this, you can look at the "Changes from Ada 83 to Ada 9X" document available on ajpo.sei.cmu.edu in public/ada9x/rm9x/v5.0/ch83_9x.{doc,ps} >Thanks in advance for anyone who can help. > > >Ken Garlington >Lockheed Fort Worth Company S. Tucker Taft stt@inmet.com Ada 9X Mapping/Revision Team Intermetrics, Inc. Cambridge, MA 02138