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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b307bd75c8071241 X-Google-Attributes: gid103376,public From: kaz@vision.crest.nt.com (Kaz Kylheku) Subject: Re: newbie Q: storage management Date: 1997/05/04 Message-ID: <5kgtf1$js1@bcrkh13.bnr.ca>#1/1 X-Deja-AN: 239212188 References: <5k5hif$7r5@bcrkh13.bnr.ca> Organization: Prism Systems Inc. Newsgroups: comp.lang.ada Date: 1997-05-04T00:00:00+00:00 List-Id: In article , Robert Dewar wrote: >Jon answers Kaz: > ><<> I know that it is possible to instantiate a generic freeing function >> for explicitly destroying objects. But why is there is this lack of >> symmetry in the language? > >Basically, this asymmetry is there because the designers did not think >they could "require" GC (at least at the level of the high expectation >of it for things like Lisp, Eiffel, ST, etc.) because many of the >target areas of use would not need (or even require _not_ having) GC. >But, the designers (especially Ada83) really were GC adherents, so >they compromised and suggested that GC would be a very good thing for >implementations to provide, but had to leave the door open for >impls. only supplying manual deallocation.>>> > > >Jon, I don't think this is the right answer, you are focussing too much >on GC, but the question was not about GC, it was about the asymmetry >(i.e. new is a straight forward primitive, free rquires a messy >instantiation). > >In fact the assymetry is quite deliberate, and reflects the fact that >new is safe (cannot result in erroneous execution), but free is dangerous >(and can easily result in erroneous execution if misused). Yes, that's all I really wanted to know, and I suspected as much. It's perfectly clear that since a conforming Ada implementation is not required to supply GC, a maximally portable Ada program cannot rely on its presence. It would be foolhardy to write a program that expects the implementation to locate unreachable objects and reclaim them, when the language doesn't require the facility.