comp.lang.ada
 help / color / mirror / Atom feed
From: "Theodore E. Dennison" <dennison@escmail.mmc.orl.com>
Subject: Re: Language Lawyers help on rep_specs
Date: 3 Jan 1995 14:50:55 GMT
Date: 1995-01-03T14:50:55+00:00	[thread overview]
Message-ID: <3ebo8f$jlo@theopolis.orl.mmc.com> (raw)
In-Reply-To: 393@hathor.CSS.GOV

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.



  reply	other threads:[~1995-01-03 14:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-01-03 12:49 Language Lawyers help on rep_specs Jeff Etrick
1995-01-03 14:50 ` Theodore E. Dennison [this message]
1995-01-03 16:30   ` Tucker Taft
1995-01-03 18:04   ` Robert Dewar
1995-01-03 18:07   ` Robert Dewar
1995-01-03 15:06 ` Robert Dewar
1995-01-04 14:40 ` Norman H. Cohen
replies disabled

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