From: stt@spock.camb.inmet.com (Tucker Taft)
Subject: Re: Language Lawyers help on rep_specs
Date: Tue, 3 Jan 1995 16:30:47 GMT
Date: 1995-01-03T16:30:47+00:00 [thread overview]
Message-ID: <D1u8JC.8zu@inmet.camb.inmet.com> (raw)
In-Reply-To: 3ebo8f$jlo@theopolis.orl.mmc.com
In article <3ebo8f$jlo@theopolis.orl.mmc.com>,
Theodore E. Dennison <dennison@escmail.mmc.orl.com> wrote:
>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;
No, your vendor is completely incorrect ;-). "Integer()" is not a function
call, it is an explicit conversion. Unlike Ada 83, explicit
conversions can be part of a static expression in Ada 95. I suspect
they have not yet fully updated their compiler to Ada 95 rules.
> ...
>Therefore "INTEGER (Dates'first)" and "INTEGER (Dates'last)" are not
>static.
Integer(Dates'First) and Integer(Dates'Last) are both static in Ada 95.
> ...
>T.E.D.
S. Tucker Taft stt@inmet.com
Ada 9X Mapping/Revision Team
Intermetrics, Inc.
Cambridge, MA 02138
next prev parent reply other threads:[~1995-01-03 16:30 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
1995-01-03 16:30 ` Tucker Taft [this message]
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