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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ec2a500cce3658c4 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Memory leak - What the ...? Date: Thu, 14 Oct 2004 10:03:27 +0200 Message-ID: <35nvj7x2y4p.yudxy8zhlcqb$.dlg@40tude.net> References: <416BAFA4.7020400@netcabo.pt> <1a7wzucf79l28$.1ennsazn0lfe0$.dlg@40tude.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de FuJPe7ZMDxmepCfOiwa+0w4SP1+NzHc77xeTcXmi2bJGLmCVQ= User-Agent: 40tude_Dialog/2.0.12.1 Xref: g2news1.google.com comp.lang.ada:5185 Date: 2004-10-14T10:03:27+02:00 List-Id: On 13 Oct 2004 19:44:35 +0200, Mark Lorenzen wrote: > "Dmitry A. Kazakov" writes: > >> On Wed, 13 Oct 2004 07:52:59 +0100, Marius Amado Alves wrote: >> >>> At top level the abstractions of initialization, finalization and >>> assignment are totally intuitive. >> >> They are not. Ada.Finalization is a hack to be replaced by a better, safer, >> more universal model. > > Is there an AI on this? I think, it would be difficult to approach this problem by small to moderate steps, as the AI procedure is supposed to work. In any case one should first reach some consensus on the requirements. In my view they are: 1. All types should provide an ability to control initialization, finalization and copy (if not limited). This should include *all* types without any exceptions. Noticeable, the class-wide types as well (9, below). 2. Assignment and construction should be considered separate. It should be possible to have true in-place constructors. The programmer should have a choice between assignments automatically generated from copy constructors and completely overridden ":=". 3. Initialization Object : X := 1; is not assignment! 4. There should be constructors with parameters. 5. Assignment should have access to the left side. 6. Assignment should be a primitive operation and so dispatch on both sides. 7. There should be no need to call explicitly parent's default constructor ("Initialize"), destructor ("Finalize"), copy constructor ("Adjust"). Very desirable to have some "extensible subroutine" mechanics invented and deployed in the language. 8. There should be also no way to call a constructor or destructor explicitly. 9. The problem of dispatch during initialization/finalization should be considered paramount. In my view the only unambiguous and sane way to solve it is when class-wides would have constructors/destructors of their own. In this case dispatch will happen in a class-wide constructor, when all necessary specific objects are already constructed. Similarly, class-wide finalization will be made before ultimate finalization of specific objects. 10. Aggregates should be user-definable. Initialization by an aggregate should be considered as a constructor. 11. User abstract factory (a-la S'Class'Input) should be available. Have I forgot something? And isn't it too much for an AI? (:-)) -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de