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: a07f3367d7,d00514eb0749375b X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!85.158.31.10.MISMATCH!newsfeed-0.progon.net!progon.net!newsfeed.ision.net!newsfeed2.easynews.net!ision!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: initialize an array (1-D) at elaboration using an expression based on the index? Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <4b8f7f06-a817-4545-9fc6-67740c67b9d3@a4g2000prm.googlegroups.com> <4cdaad27$0$6979$9b4e6d93@newsspool4.arcor-online.net> <82e746ff-a4eb-4570-8016-78930977def1@35g2000prb.googlegroups.com> <4cdb41db$0$6980$9b4e6d93@newsspool4.arcor-online.net> Date: Thu, 11 Nov 2010 09:30:57 +0100 Message-ID: NNTP-Posting-Date: 11 Nov 2010 09:30:57 CET NNTP-Posting-Host: aac0f1a9.newsspool4.arcor-online.net X-Trace: DXC=7?`W\_LQL1Mgj[ZPFj7ehO4IUKJ X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:16401 Date: 2010-11-11T09:30:57+01:00 List-Id: On Thu, 11 Nov 2010 02:07:39 +0100, Georg Bauhaus wrote: > Just an ad-hoc idea: > > Jobs : array (X: Job_Id) of T := (others => Make(X)); > > where X: Job_Id is a little like a record discriminant > passed on to constrain components, for example, > only with a different "multiplicity". That is by no way ad-hoc, I had this idea for a long time. The array indices should have been named (optionally of course). It was missed in the Ada 83 design. Then the above could simply become: type Worker_Set is array (ID : Job_ID range <>) of T (ID); -- No discriminant default value needed -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de