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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c4003439e5ce36e1 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Converting access values Date: Wed, 12 Jan 2005 11:48:16 +0100 Organization: cbb software GmbH Message-ID: <1twp19ceo5v3w$.z96zxraucp8c.dlg@40tude.net> References: <1105462949.537976.40860@c13g2000cwb.googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: individual.net dXw2MPkSRfjlJuV0uBUG9QfQLpkIENNBbO//Toy3O1gQ3guxQ= User-Agent: 40tude_Dialog/2.0.12.1 Xref: g2news1.google.com comp.lang.ada:7683 Date: 2005-01-12T11:48:16+01:00 List-Id: On 11 Jan 2005 16:37:18 -0500, Robert A Duff wrote: > I was thinking of something like: > > for T'Aggregate use F; > > where F takes whatever parameters it likes, and does whatever it likes, > and returns an object of type T. Then: > > X := (A, B, C); > > (I'd prefer [A, B, C], actually) would simply be a shorthand for: > > X := F(A, B, C); And what to do with array aggregates? I think the issue is not that simple. I would first introduce a class of index types to make ranges, "..", "in" and "not in" first-class citizens. Then I would use an index type in the aggregate declaration instead of a subroutine name. That would cover array-like aggregates when index is numeric and function-like aggregates when index is an enumeration. But how to deal with that in-place? Array-like aggregates would require triple copying in an object initialization. That's much too much. Then what about class-wide aggregates vs. specific aggregates, dispatching aggregates and all that stuff? Consider: type Foo is tagged ...; type Baz is tagged ...; function F (X : Baz) return Foo'Class; for Foo'Class'Aggregate use F; -- What should it mean? (:-)) type Bar is new Foo with private; -- Has Bar or Bar'Class any aggregates? There is a lot to discuss to get it right. [But it should be done, of course] -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de