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-Thread: 103376,d00514eb0749375b X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder.news-service.com!2a02:590:1:1::196.MISMATCH!news.teledata-fn.de!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Wed, 10 Nov 2010 15:33:10 +0100 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: initialize an array (1-D) at elaboration using an expression based on the index? References: <4b8f7f06-a817-4545-9fc6-67740c67b9d3@a4g2000prm.googlegroups.com> In-Reply-To: <4b8f7f06-a817-4545-9fc6-67740c67b9d3@a4g2000prm.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <4cdaad27$0$6979$9b4e6d93@newsspool4.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 10 Nov 2010 15:33:11 CET NNTP-Posting-Host: 76d6fae9.newsspool4.arcor-online.net X-Trace: DXC=JZbdjZS0_@dfF8a^:6>b7e4IUKjLh>_cHTX3jmbN@GOa:nihh X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:15420 Date: 2010-11-10T15:33:11+01:00 List-Id: On 16.10.10 02:16, Adam Beneschan wrote: > It seems like it would be simple to add syntax to array aggregates in > the language like > > a : array(1..N) of Float := (for I in 1..N => Float(I)*Float(I)); I have an array of library level task objects. Each task is supposed have a unique identifying number, fixed and assigned at compile time. Perhaps starting from a task type definition like the following one: task T (Identity : Job_Id := No_Job) is ... Could some variation of the (for ...) expression solve this, i.e. provide the initial value? Jobs : array (Job_Id) of T := (for D in Job_Id => ???(D)); Borrowing from limited types, I'd think "???" might be just "T"? Jobs : array (Job_Id) of T := (for D in Job_Id => T (D)); Georg