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,92882847c09de3aa X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-01-03 08:39:37 PST Path: nntp.gmd.de!newsserver.jvnc.net!news.cac.psu.edu!news.pop.psu.edu!psuvax1!uwm.edu!spool.mu.edu!bloom-beacon.mit.edu!boulder!news.coop.net!news.den.mmc.com!iplmail.orl.mmc.com!usenet From: "Theodore E. Dennison" Newsgroups: comp.lang.ada Subject: Re: Language Lawyers help on rep_specs Date: 3 Jan 1995 14:50:55 GMT Organization: IPL InterNetNews site Message-ID: <3ebo8f$jlo@theopolis.orl.mmc.com> References: <393@hathor.CSS.GOV> NNTP-Posting-Host: payday.orl.mmc.com Date: 1995-01-03T14:50:55+00:00 List-Id: jeffe@hathor.CSS.GOV (Jeff Etrick) wrote: > > > Dear Language Lawyers, > (stuff deleted) > The LRM references are saying that my type Nuclear_Date_Times may not be > used in a record represenation clause due to the fact it is not a simple > static expression. Talking to the vendor about this issue I was told that the > INTEGER conversion is a function and functions are not allowed in simple > static expressions. > > Looking at 4.9(6) "a function_call whose function_name .........." > tells me that static functions are allowed. > > My vendor insists that my program violates the LRM, could you please > enlighten me on this. Which vendor is executing this program correctly? (code deleted) > type Dates is new Full_Integer range -1 .. 56_613; (code deleted) > type Nuclear_Date_Times is new Full_Integer > range (INTEGER (Dates'first) - 1) * MINUTES_IN_DAY > .. (INTEGER (Dates'last) * MINUTES_IN_DAY) - 1; Your vendor is partly correct; only functions which are "operators" may be used in static expressions. My LRM 4.9(7) (where did you get 6?) says: (e) A function call whose function name is an operator symbol that denotes a predefined operator... section 4.5 (2) defines operator symbols to be: "and", "or", "xor", "=", "/=", "<", "+", "-", "/", etc. "INTEGER" is not in the list. Therefore "INTEGER (Dates'first)" and "INTEGER (Dates'last)" are not static. I would suggest you try either: o - make "Dates" a subtype of "Nuclear_Date_Times" or o - use "Dates'pos(Dates'first)" and "Dates'pos(Dates'last)" instead. T.E.D.