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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED.3d73Ybk3C5U4I2t8lv+lAQ.user.gioia.aioe.org!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Initializing an array of tasks with discrimants Date: Sat, 23 Nov 2019 18:03:54 +0100 Organization: Aioe.org NNTP Server Message-ID: References: <358a3934-7cb2-4cff-8703-71410815f27e@googlegroups.com> <91db9356-1b6a-4426-a9c7-c19613c654e8@googlegroups.com> NNTP-Posting-Host: 3d73Ybk3C5U4I2t8lv+lAQ.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 Content-Language: en-US X-Notice: Filtered by postfilter v. 0.9.2 Xref: reader01.eternal-september.org comp.lang.ada:57605 Date: 2019-11-23T18:03:54+01:00 List-Id: On 2019-11-23 17:28, Jere wrote: > Yes, for ID's. I really dialed down the example > code for simplicity. The actual scenario isn't > ID's but a set of enumerations that provide > configuration data for the tasks. Then you should rather ask when Ada will get user-defined constructors and user-defined aggregates. The former is required to determine task discriminants from whatever set of parameters ("virtual disciminants") you please. The latter is required to initialize array using a procedure handing a list of whatever "virtual" elements. > I was mostly just seeing > if I could do away with the wrapper record for > initialization. And make your program unstable because of using hideous kludges no Ada vendor will ever make work same way in two consecutive compiler versions? I would rather stay safe: Ada 95 + interfaces (where needed) + prefix notation (where needed), no fancy stuff. Good old task initialization patterns: 1. Start entry task type T is entry Start (whatever parameters); ... end T; V : A (1..10); begin V (1).Start (...); V (2).Start (...); ... 2. Task parameters factory object, e.g. passed as an access discriminant. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de