From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Initializing an array of tasks with discrimants
Date: Sat, 23 Nov 2019 18:03:54 +0100
Date: 2019-11-23T18:03:54+01:00 [thread overview]
Message-ID: <qrbopp$do2$1@gioia.aioe.org> (raw)
In-Reply-To: 91db9356-1b6a-4426-a9c7-c19613c654e8@googlegroups.com
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
next prev parent reply other threads:[~2019-11-23 17:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-22 22:07 Initializing an array of tasks with discrimants Jere
2019-11-22 22:39 ` Jeffrey R. Carter
2019-11-23 16:23 ` Jere
2019-11-22 23:57 ` Robert A Duff
2019-11-23 0:27 ` Anh Vo
2019-11-23 9:12 ` Randy Brukardt
2019-11-23 16:50 ` Jere
2019-11-23 16:25 ` Jere
2019-11-23 8:29 ` Dmitry A. Kazakov
2019-11-23 16:28 ` Jere
2019-11-23 17:03 ` Dmitry A. Kazakov [this message]
2019-11-23 16:57 ` Jere
2019-11-25 22:36 ` Randy Brukardt
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox