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.4 required=5.0 tests=BAYES_00,SUBJ_ALL_CAPS autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,51359402da60c472 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-01 00:19:36 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!skynet.be!skynet.be!fu-berlin.de!uni-berlin.de!tar-alcarin.cbb-automation.DE!not-for-mail From: Dmitry A. Kazakov Newsgroups: comp.lang.ada Subject: Re: DYNAMIC ADA TASK CREATION? Date: Tue, 01 Jul 2003 09:19:34 +0200 Message-ID: References: <3EF0026E.2050309@attbi.com> <3EF0F57D.9060507@attbi.com> <3EF15A7C.4030901@attbi.com> <1ec946d1.0306271654.636c1373@posting.google.com> <3EFD42B5.2060707@attbi.com> <0gpvfv49qaa0b62ab5m0kg39kka66sis8t@4ax.com> <1ec946d1.0306300701.77505dcf@posting.google.com> NNTP-Posting-Host: tar-alcarin.cbb-automation.de (212.79.194.111) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: fu-berlin.de 1057043975 32312569 212.79.194.111 (16 [77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:39945 Date: 2003-07-01T09:19:34+02:00 List-Id: On 30 Jun 2003 08:01:29 -0700, mheaney@on2.com (Matthew Heaney) wrote: >Dmitry A. Kazakov wrote in message news:<0gpvfv49qaa0b62ab5m0kg39kka66sis8t@4ax.com>... >> On Sat, 28 Jun 2003 07:25:02 GMT, "Robert I. Eachus" >> 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