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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,735c710b5e547bad X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Received: by 10.224.182.77 with SMTP id cb13mr1321968qab.5.1343313336454; Thu, 26 Jul 2012 07:35:36 -0700 (PDT) Received: by 10.66.80.168 with SMTP id s8mr1393500pax.28.1343312372352; Thu, 26 Jul 2012 07:19:32 -0700 (PDT) Path: a15ni113198934qag.0!nntp.google.com!q21no663428qas.0!news-out.google.com!p10ni61947386pbh.1!nntp.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!novia!feed-C.news.volia.net!volia.net!news2.volia.net!feed-A.news.volia.net!border1.nntp.ams2.giganews.com!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!newsfeed.straub-nv.de!news2.arglkargh.de!news.mixmin.net!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Ada 2005 puzzle Date: Sun, 22 Jul 2012 10:03:29 +0200 Organization: cbb software GmbH Message-ID: References: <1arp60wtxes8h$.1qs6bt732ztgp.dlg@40tude.net> <030cde76-7435-405d-9f12-ac7f730ecab8@googlegroups.com> <1f9q6vk5z2r3t$.1hayo9rmxfwu7$.dlg@40tude.net> <7308644e-bfbe-44c1-8359-d67392d483e1@googlegroups.com> <72bc2c23-4a1c-4c09-985e-8cc4c0fd957f@googlegroups.com> <1uli63mb1e82x.11cuz41guddr5.dlg@40tude.net> <12fbl1qrjckwi$.xk9v9nzzcj21.dlg@40tude.net> <2a1f6145-2aa1-4af3-aca0-2fc0b3a78efe@googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: 9A8bJrx4NhDLcSmbrb6AdA.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 X-Original-Bytes: 3117 X-Received-Bytes: 3399 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: 8bit Date: 2012-07-22T10:03:29+02:00 List-Id: On Sat, 21 Jul 2012 15:46:47 -0700 (PDT), Maciej Sobczak wrote: > W dniu pi�tek, 20 lipca 2012 14:49:14 UTC+2 u�ytkownik Dmitry A. Kazakov napisa�: > >> I meant here a different thing. If you have some dispatching operations to >> be performed upon initialization, > > I'm not sure what possible use-case would motivate it - I don't see any in > the container's interface. Containers are not supposed to be more smart > than necessary, they just have to keep objects. But they cannot be more stupid than objects they keep. The use case is a container of T'Class. T is abstract. Upon its initialization, which is non-abstract, the initialization calls to an abstract operation Foo: procedure Initialize (X : in out T) is begin ... Foo (T'Class (X)); end Initialize; >> Let you have a hierarchy of types T1:>T2:>T3. Then construction should run >> as follows: >> >> stage 1 >> T1 constraints evaluation >> T2 constraints >> T3 constraints >> >> allocation >> >> stage 2 >> T1 initialization >> T2 initialization >> T3 initialization >> >> stage 3 >> T1'Class initialization, only here we could dispatch on T1'Class >> T2'Class initialization >> T3'Class initialization >> >> 1-3 cannot be effectively fused into single operation > > Stage 3 is implicit, so we don't have to care, Actually we have to, not only because people want to dispatch upon initialization. The same problem arise with Rosen's trick. Most typically when a component of T1 is a task carrying T1'Class as an access discriminant. When you wanted a rendezvous with the task upon initialization, you get a nice deadlock (or Tasking_Error). Component tasks are created during 2. They start no earlier than during 3. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de