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, MSGID_SHORT autolearn=no autolearn_force=no version=3.4.4 Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!seismo!sundc!rlgvax!vrdxhq!deller From: deller@vrdxhq.UUCP Newsgroups: comp.lang.ada Subject: Re: 'Base and Staticness Message-ID: <3411@vrdxhq.UUCP> Date: Tue, 14-Apr-87 03:48:24 EST Article-I.D.: vrdxhq.3411 Posted: Tue Apr 14 03:48:24 1987 Date-Received: Wed, 15-Apr-87 04:47:41 EST References: <12293281394.11.MENDAL@Sierra.Stanford.EDU> <1132@wayback.UUCP> Organization: Verdix Corporation, Chantilly, VA Summary: type conversion is not static List-Id: 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 -- ::= | | | {verdix,seismo,umcp-cs}!vrdxhq!deller