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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c7fc5da0a4cc955c X-Google-Attributes: gid103376,public From: stt@houdini.camb.inmet.com (Tucker Taft) Subject: Re: unconstrainded array question Date: 1998/09/19 Message-ID: #1/1 X-Deja-AN: 392709141 Sender: news@inmet.camb.inmet.com (USENET news) X-Nntp-Posting-Host: houdini.camb.inmet.com References: Organization: Intermetrics, Inc. Newsgroups: comp.lang.ada Date: 1998-09-19T00:00:00+00:00 List-Id: Technobabble (therionics@computer.org) wrote: : Greetings, : anyone know if it is legal or not in Ada95 to use a RANGE attribute on : an unconstrained array, as in the example: There is no such thing as an "unconstrained" array object. There are unconstrained array *subtypes*." In the example below, the "first subtype" UC_Array of the array type is unconstrained, but the subtype of the object xyz is constrained to 1..100. Extra care here in using terminology is important. : package My_Package is : procedure XYZ (This : in Object); : type UC_Array is array (integer <>) of integer; : xyz : AC_Array (1..100); ^^^ This is illegal overloading by the way, since you can't have both an overloadable declaration like the procedure XYZ and a non-overloadable declaration like the array xyz in the same declarative region (remember upper/lower case is irrelevant in Ada identifiers). : end My_Package; : then in the body .... : procedure XYZ (This : Object) is : begin : for I in This.xyz'RANGE The 'Range attribute is allowed on *all* array objects, and on all *constrained* array subtypes. So UC_Array'Range would be illegal, but 'Range is allowed. : loop : ...... : end XYZ; : Thanks, : Richmond -- -Tucker Taft stt@inmet.com http://www.inmet.com/~stt/ Intermetrics, Inc. Burlington, MA USA An AverStar Company