comp.lang.ada
 help / color / mirror / Atom feed
From: deller@vrdxhq.UUCP
Subject: Re: 'Base and Staticness
Date: Tue, 14-Apr-87 03:48:24 EST	[thread overview]
Date: Tue Apr 14 03:48:24 1987
Message-ID: <3411@vrdxhq.UUCP> (raw)
In-Reply-To: 1132@wayback.UUCP

In article <1132@wayback.UUCP>, arny@wayback.UUCP (Arny B. Engelson) writes:

> > Is the following package specification semantically valid?
> >   package Static_Test is
> >     subtype Non_Static is Integer range Integer (1) .. 100;
> >     type Must_Be_Static is range Non_Static'Base'First .. 10;
> >   end Static_Test;
> > Read the ARM, 3.3.3(8..9) and 4.9(1..2, 8, 11).
> 
> ... I believe the subtype "Non_Static" is
> indeed static.  This subtype is formed by imposing a static range constraint
> (1..100) on a scalar base type (Integer).  (Note that enclosing the numeral 1
> in parentheses does not make it non-static according to 4.9:2,4,10).
> . . .

I believe you missed the fact that instead of "1", the expression is 
"Integer (1)", not simply "(1)".  "Integer (1)" is a type conversion, which is 
not listed in RM 4.9 as a static primary.  Using a "non-modifying" type
conversion is one of the typical "tricks" used to make expressions non-static.

Note that "Integer'(1)" is a qualified expression, which _is_ a static 
expression primitive, and is more likely to be used when "casting" (What, how
did C sneak in here?) a literal to a specific type.

Steven Deller,
Verdix
-- 
<end_message> ::= <disclaimer> | <joke> | <witty_saying> | <cute_graphic>
{verdix,seismo,umcp-cs}!vrdxhq!deller

      reply	other threads:[~1987-04-14  8:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <12293281394.11.MENDAL@Sierra.Stanford.EDU>
1987-04-13 13:45 ` 'Base and Staticness arny
1987-04-14  8:48   ` deller [this message]
replies disabled

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