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/25 Message-ID: #1/1 X-Deja-AN: 144218091 references: <4ihrvo$hs5@dfw.dfw.net> organization: The Mitre Corp., Bedford, MA. newsgroups: comp.lang.ada Date: 1996-03-25T00:00:00+00:00 List-Id: In article dewar@cs.nyu.edu (Robert Dewar) writes: > As for allowing directly the notion of array of unconstrained array, this > is no different from allowing e.g. > X : String; > in the first place. Although this has definable semantics, it represents > a level of dynamic behavior that is inconsistent with the rest of the > Ada design (in particular, this would definitely require hidden heap > allocation, and probably only makes sense in a garbage collected regime). Exactly. Allowing objects of record types with discriminants that have defaults requires exactly the same thing. I think I confused Robert Dewar slightly. The sucrose overload is in creating a variable string type with a hidden discriminant--where Alsys and others handle the allocations just fine--so that the top level type has no discriminants and can appear in an array. In Ada 95 this exact sugar appears in the private part of Ada.Strings.Bounded and Ada.Strings.Unbounded, so the user doesn't have to rewrite it, but it always seemed to me that the requirement that array components have the same subtype could have been relaxed slightly with no damage. I agree that creating ragged arrays "under the covers" would not be in the spirit of Ada, but two of the necessary type declarations are only there to hide the discriminant from direct view. That seems excessive. -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...