comp.lang.ada
 help / color / mirror / Atom feed
From: AdaMagica <christ-usch.grein@t-online.de>
Subject: Arrays with discriminated task components
Date: Sat, 24 Dec 2022 03:44:27 -0800 (PST)	[thread overview]
Message-ID: <9b729cf0-02c7-48e1-8cea-c0d177c4bf3bn@googlegroups.com> (raw)

I've got a task type with a discriminant:

type Index is range 1 .. N;

task type T (D: Index);

Now I want an array of these tasks, where each task knows its identity (the index) via the discriminant, an iterated_component_association:

Arr: array (Index) of T := (for I in Index => ???);

How can I do this?

This works with access, but I find this extremely ugly:

Arr: array (Index) of access T := (for I in Index => new T (I));

Alternatively, I could use the traditional method with a Start entry with the index as parameter:

task type T is
  entry Start (D: Index);
end T;

             reply	other threads:[~2022-12-24 11:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-24 11:44 AdaMagica [this message]
2022-12-24 18:05 ` Arrays with discriminated task components Niklas Holsti
2022-12-24 22:41   ` Jeffrey R.Carter
2022-12-25 15:32     ` Niklas Holsti
2022-12-25 16:16 ` Niklas Holsti
2022-12-26 16:39   ` AdaMagica
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox