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: 103376,4e5770c49b971630 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder.news-service.com!kanaga.switch.ch!news-zh.switch.ch!switch.ch!news.belwue.de!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: High-Integrity OO and controlled types Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <679e3217-98dd-43c1-86f6-2038a029c3ea@b19g2000yqg.googlegroups.com> <94f3a272-d071-4a74-bfbd-8f2b4c2347cf@m10g2000yqd.googlegroups.com> <4dbfe6cc$0$7664$9b4e6d93@newsspool1.arcor-online.net> <1in9ypl17vu1t$.1shivr91x8zw6.dlg@40tude.net> <4dc01dca$0$6885$9b4e6d93@newsspool2.arcor-online.net> Date: Tue, 3 May 2011 18:28:11 +0200 Message-ID: <1ds39akl3dbii$.mlyj7piip5o3.dlg@40tude.net> NNTP-Posting-Date: 03 May 2011 18:28:10 CEST NNTP-Posting-Host: 1bb93059.newsspool4.arcor-online.net X-Trace: DXC=d_:3=NEnW6^=>bdbdS?M0Y4IUK On Tue, 03 May 2011 17:22:50 +0200, Georg Bauhaus wrote: > On 03.05.11 14:27, Dmitry A. Kazakov wrote: >> On Tue, 03 May 2011 13:28:12 +0200, Georg Bauhaus wrote: >> >>> On 03.05.11 11:59, Maciej Sobczak wrote: >>> >>>> Another angle: the fact that the lack of controlled types in HI >>>> profiles can be considered as a problem is entirely a result of the >>>> fact that Ada completely screwed this aspect at the beginning. >>>> Controlledness should not be based on tags - it should be a completely >>>> orthogonal property of the type, >>> >>> Actually, in non-flat languages like Ada, scope exit >>> actions should be based on scopes, not (just) types, >>> as types can effectively span multiple scopes. >> >> But typed languages tend to consider actions as operations defined on >> types, with certain contracts, reusable, clearly bound effects etc. >> >> Actions as amorphous chunks of code tossed here and there depending on >> scope is a way different ["anisotropic"] approach. In particular it does >> not fit into safe modular software design, because of this "anisotropy". > > What will type-object/module code look like if it is equivalent > to its nested analog? Better? Analogue of what? The point is that "finally" cannot replace initialization and finalization of objects, specific or class-wide. The opposite is wrong. Any example where "finally" might be useful is motivated by improperly designed types, e.g. File_Type, which does not close itself upon destruction. > My guess is that to achieve the necessary linking, one passes > Italian food handles to constructors and/or established registries > that receive "events" like "a scope X has been left". See above, you need not to handle scopes. Scopes are ad-hoc, used for the purpose of defining the lifespan of some objects. Leaving scope is as event as leaving loop, leaving the else alternative of an if etc. If you need such events re-design! > For example, assuming something like the naturally nested > Integrate function. BTW, integrating function is an object. For this object the compiler generates finalization, which in particular kills the closure. Care to show how to do this using "finally"? -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de