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,7aeecd1069c28415 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Objects and the Stack? Date: Mon, 20 Dec 2004 19:31:48 +0100 Organization: cbb software GmbH Message-ID: <1os47ftvazhq.1cc2aoj13qfb8.dlg@40tude.net> References: <32ej4pF3k243eU1@individual.net> <32o755F3p3ddbU1@individual.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: individual.net qBKc3HbMWLDPu+1zD5wSQwp9M1p6teeLBD3KLgQdrllDDQD9I= User-Agent: 40tude_Dialog/2.0.12.1 Xref: g2news1.google.com comp.lang.ada:7096 Date: 2004-12-20T19:31:48+01:00 List-Id: On Mon, 20 Dec 2004 16:22:44 +0000, Marius Amado Alves wrote: >> ... apparently my development activities must center on those few areas, >> since I'm constantly using access types due to the unknowable-in-advance >> quantities and structural relationships of the data that I'm dealing with. > > You should attend a "No Pointers, Great Programs" tutorial :-) > > The whole problem with pointers is that languages (incorrectly) mix > _allocation_ and _reference_ in them. Every complex design has > referential needs (names). A pointerless approach tries to insolate that > from the allocation troubles. This is exactly the idea of pointer, I am afraid. You allocate object somewhere and reference it elsewhere. Isolation here means that you can copy that reference independently from the object with all consequences of that. In my view there is only one approach to the problem: static scopes. It is objects allocated on the stack and also it is accessibility rules if the former does not help. These both are directly supported in Ada. When that does not help there are smart pointers. And it is again about static scopes, though ones of pointers. The decision to destroy an object is made when a the last pointer goes out of scope. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de