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,177ff20edf7f64cf X-Google-Attributes: gid103376,public From: eachus@spectre.mitre.org (Robert I. Eachus) Subject: Re: Unconstrained array aggregation..sq. peg into round hole? Date: 1996/03/21 Message-ID: #1/1 X-Deja-AN: 143660876 references: <4ihrvo$hs5@dfw.dfw.net> organization: The Mitre Corp., Bedford, MA. newsgroups: comp.lang.ada Date: 1996-03-21T00:00:00+00:00 List-Id: In article bobduff@world.std.com (Robert A Duff) writes: > Right, except you have to give a constraint. Array-of-unconstrained > array is illegal. Not really, but you have to put two records in the middle to make it work: subtype Limited_Subscripts is Natural range 1..1000; type Real_Array is array (Limited_Subscripts range <>) of Float; type Inner_Wrapper is (First: Integer := 1; Last: Integer := 0) is record B: Real_Array(First..Last); end record; type Outer_Wrapper is A: Inner_Wrapper; end record; type Ragged_Table is array (Natural range <>) of Outer_Wrapper; I never understood why, if this useful and used feature was in Ada 83 and Ada 95, you have to go through all this semantic sugar to create the ragged array type. To keep novice users from trying it? (The Limited_Subscripts subtype is so that this will work on all implementations including those that "allocate the maximum" for this type of subcomponent.) -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...