comp.lang.ada
 help / color / mirror / Atom feed
From: Niklas Holsti <niklas.holsti@tidorum.invalid>
Subject: Re: tasks as part of record
Date: Sun, 05 Oct 2014 11:11:27 +0300
Date: 2014-10-05T11:11:27+03:00	[thread overview]
Message-ID: <c9ccpaF6mooU1@mid.individual.net> (raw)
In-Reply-To: <294a973f-5222-4aa3-8971-777cd2eb9174@googlegroups.com>

On 14-10-04 16:11 , Stribor40 wrote:
> ... can someone show me how to create few records where each
> record contain task please. Say if I want record Student...
> 
>   type Student is record
>        Student_Number  : Positive range 1 .. N;
>        Name : String(1..20);
>        Count    : Integer ;
>        --??tasks
>    end record;

Embedding tasks in the data structure is usually not a good idea. For
one thing, tasks are "limited" types, so the Student record type also
becomes "limited", and you can no longer move such record objects from
here to there with assignment statements. For another thing, each task
needs its own stack and control structures, which can consume
significant amounts of memory. Finally, the execution state of a task
can be complex and is private to the task and is not directly visible or
controllable from "outside", as the values of other kinds of
data-structure components are.

Can you explain what you want to accomplish here? What is this task
supposed to do, and why must it be embedded in a Student record?

-- 
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
      .      @       .


  parent reply	other threads:[~2014-10-05  8:11 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-04 13:11 tasks as part of record Stribor40
2014-10-04 13:33 ` Simon Wright
2014-10-04 22:12 ` Stribor40
2014-10-05  7:36   ` Jacob Sparre Andersen
2014-10-05  8:11 ` Niklas Holsti [this message]
2014-10-06  3:47   ` Stribor40
2014-10-06  5:43     ` Jeffrey Carter
2014-10-06  7:18     ` Niklas Holsti
2014-10-06  8:00       ` Dmitry A. Kazakov
2014-10-06 11:40         ` G.B.
2014-10-06  8:06       ` Simon Wright
2014-10-06  8:24     ` Simon Wright
2014-10-12 22:33       ` compguy45
2014-10-13  7:32         ` Simon Wright
2014-10-13 14:45           ` compguy45
2014-10-13 15:33             ` Shark8
2014-10-18 18:21           ` Stephen Leake
replies disabled

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