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,bd40601768eaf8fd X-Google-Attributes: gid103376,public From: "Matthew Heaney" Subject: Re: Array of Variant Records Question... Date: 1999/09/08 Message-ID: <37d6ccb6@news1.prserv.net>#1/1 X-Deja-AN: 522664371 Content-transfer-encoding: 7bit References: <7r5vh3$imu1@svlss.lmms.lmco.com> <37d6a45c@news1.prserv.net> Content-Type: text/plain; charset="US-ASCII" X-Complaints-To: abuse@prserv.net X-Trace: 8 Sep 1999 20:53:10 GMT, 32.101.8.119 Organization: Global Network Services - Remote Access Mail & News Services Mime-version: 1.0 Newsgroups: comp.lang.ada Date: 1999-09-08T00:00:00+00:00 List-Id: In article , "Mike Silva" wrote: > I didn't get it -- what is the flaw? What would be the "proper" solution to > remove the flaw? > Mike > > Matthew Heaney wrote in message <37d6a45c@news1.prserv.net>... > >>Sorry it's a bit complicated; this is one of the glaring flaws in the >>language. But as you can see there is a work-around. To have array initialization a la Fortran, something like: type T (Id : Positive := 1) is record ... end record; type TA is array (Positive range <>) of T; function Init (I : Positive) return T; O : TA (1 .. 5) := (for I in O'Range => O (I) := Init (I)); where function Init (I : Positive) return T is O : TA (I); begin return O; end Init; This syntax is off the top of my head; there are probably better ways to do it, that would obviate the need for Init. The language maintainers also have to settle the issue of invoking constructors for limited types during the declaration of the object. One proposal is to allow constructors (functions returning T) to be called in the declarative region.