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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6433f675cae9b5bc X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-30 20:24:03 PST Newsgroups: comp.lang.ada Path: supernews.google.com!sn-xit-03!supernews.com!newsswitch.lcs.mit.edu!howland.erols.net!portc.blue.aol.com.MISMATCH!portc03.blue.aol.com!uunet!dca.uu.net!ash.uu.net!world!bobduff From: Robert A Duff Subject: Re: Allocate an array of a record with a discriminant? Sender: bobduff@world.std.com (Robert A Duff) Message-ID: Date: Sat, 31 Mar 2001 04:22:43 GMT References: Organization: The World Public Access UNIX, Brookline, MA X-Newsreader: Gnus v5.3/Emacs 19.34 Xref: supernews.google.com comp.lang.ada:6280 Date: 2001-03-31T04:22:43+00:00 List-Id: "Mark Lundquist" writes: > > type Words (Max_Word_Length : Integer) is array (Natural range <>) of Word > > (Max_Word_Length); > > You're right, an array type can't be a discriminated type (remember, a > discriminant is a special kind of component, and while that fits into the > idea of a record -- which has named components of arbitrary types -- it > doesn't fit into the idea of an array, where all the components are of the > same type and all are indexable over a range). I think it makes perfect sense for arrays to have discriminants. It just happens that Ada doesn't allow it. In fact, I would say that if array bounds and discriminants were treated as the same thing, the language would be simplified. I realize this doesn't answer the original question -- but you did that quite nicely in the rest of your posting (which I snipped). - Bob