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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4f0b59438ce4c5b9 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-19 09:47:00 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.stueberl.de!newspeer1-gui.server.ntli.net!ntli.net!newsfep4-winn.server.ntli.net.POSTED!53ab2750!not-for-mail From: chris User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031014 Thunderbird/0.3 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Deallocation & Tagged Types References: <5Fhkb.3195$KA5.27417@newsfep4-glfd.server.ntli.net> <3F92AFF6.8050001@comcast.net> In-Reply-To: <3F92AFF6.8050001@comcast.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <8ezkb.5981$mM1.925@newsfep4-winn.server.ntli.net> Date: Sun, 19 Oct 2003 17:53:09 +0100 NNTP-Posting-Host: 81.98.236.129 X-Complaints-To: abuse@ntlworld.com X-Trace: newsfep4-winn.server.ntli.net 1066582020 81.98.236.129 (Sun, 19 Oct 2003 17:47:00 BST) NNTP-Posting-Date: Sun, 19 Oct 2003 17:47:00 BST Organization: ntl Cablemodem News Service Xref: archiver1.google.com comp.lang.ada:1144 Date: 2003-10-19T17:53:09+01:00 List-Id: Robert I. Eachus wrote: > > This is what Controlled types were added to the language for, why aren't > you using them? In your example, if Vehicle is a controlled type, you > don't have a problem. If Vehicle has no required finalization, it > doesn't need to be derived from Controlled (or Limited_Controlled) but > again, as the programmer of an abstraction that uses Vehicle, you don't > have to worry about it. In the real code, the types *are* controlled. The problem was how to get rid of X when X is of type access to Vehicle'Class, not how to tidy up X after use when it is a Vehicle. I wasn't clear sorry. I tried instantiating Unchecked_Deallocation on Vehicle and not Vehicle'Class not knowing you could do that. > (Note: I understand that if someone programs an abstraction > incorrectly, that is a problem. But it is also a bug in the ADT that > needs to be fixed there. Code that includes workarounds for bugs in the > ADTs used is twice wrong. Once because the original type should be > corrected, and the second time because fixing the base abstraction is > now going to create a follow-on bug.) Yes the ADT abstraction was broken, but only after trying to get around the problem of deallocating the access component in the record. The ugliness is (IMO) gone now. Chris