comp.lang.ada
 help / color / mirror / Atom feed
From: Dmitry A. Kazakov <mailbox@dmitry-kazakov.de>
Subject: Re: DYNAMIC ADA TASK CREATION?
Date: Tue, 01 Jul 2003 09:19:34 +0200
Date: 2003-07-01T09:19:34+02:00	[thread overview]
Message-ID: <tnc2gvkr3fu9rpkd0tu56095ttbuflkgi9@4ax.com> (raw)
In-Reply-To: 1ec946d1.0306300701.77505dcf@posting.google.com

On 30 Jun 2003 08:01:29 -0700, mheaney@on2.com (Matthew Heaney) wrote:

>Dmitry A. Kazakov <mailbox@dmitry-kazakov.de> wrote in message news:<0gpvfv49qaa0b62ab5m0kg39kka66sis8t@4ax.com>...
>> On Sat, 28 Jun 2003 07:25:02 GMT, "Robert I. Eachus"
>> <rieachus@attbi.com> wrote:
>> 
>> >    generic
>> >      type Element is limited private;
>> 
>> A short question. Why not:
>> 
>>    type Element (<>) is limited private;
>> 
>> [I am using this in my containers because it is weaker than just
>> limited private.]
>
>Because the type must be definite, of course!  Otherwise, how would
>you know how much space to allocate for the object?
>
>Consider the following type (as you've declared it above):
>
>package P is
>   type T (<>) is limited private;
>private
>   type T is limited null record;
>end P;
>
>Here's a little puzzle: how do you declare an instance of type T?

I thought the container has only pointers to instances which are
created by caller, but maybe I missed something.

[ An advantage in having (<>) for Element is that it could then have
T'Class as actual. For example:

type Operand is new Ada.Finalization.Limited_Controlled with private;
type Operand_Ptr is access all Operand'Class;
...
package Argument_Stack is new Limited_Stack
   (Element => Operand'Class, Pointer => Operand_Ptr);
]

---
Regards,
Dmitry Kazakov
www.dmitry-kazakov.de



  reply	other threads:[~2003-07-01  7:19 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-17 19:53 DYNAMIC ADA TASK CREATION? avram
2003-06-17 20:24 ` Simon Wright
2003-06-18  6:11   ` Robert I. Eachus
2003-06-18  9:20     ` Georg Bauhaus
2003-06-18 11:13       ` John McCabe
2003-06-18 12:43         ` John McCabe
2003-06-18 14:17           ` Georg Bauhaus
2003-06-19  5:07         ` Simon Wright
2003-06-19  6:05           ` Robert I. Eachus
2003-06-19 23:30             ` Jeffrey Carter
2003-06-18 19:15     ` avram
2003-06-18 21:17       ` Craig Carey
2003-06-20 18:56         ` avram
2003-06-21 13:06           ` Pascal Obry
2003-06-18 23:28       ` Robert I. Eachus
2003-06-19  5:09         ` Simon Wright
2003-06-19  6:39           ` Robert I. Eachus
2003-06-19 20:34             ` Simon Wright
2003-06-28  0:54             ` Matthew Heaney
2003-06-28  7:25               ` Robert I. Eachus
2003-06-30  7:35                 ` Dmitry A. Kazakov
2003-06-30 15:01                   ` Matthew Heaney
2003-07-01  7:19                     ` Dmitry A. Kazakov [this message]
2003-07-01 14:21                       ` Matthew Heaney
2003-07-02 12:05                     ` Mário Amado Alves
2003-07-02 19:41                       ` Simon Wright
2003-07-03 21:31                         ` Mário Amado Alves
2003-07-03  9:53                   ` Robert I. Eachus
replies disabled

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