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,FREEMAIL_FROM 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 18:08:33 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.mathworks.com!wn13feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!rwcrnsc54.POSTED!not-for-mail Message-ID: <3F933577.9030104@comcast.net> From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01 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> <8ezkb.5981$mM1.925@newsfep4-winn.server.ntli.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 24.34.139.183 X-Complaints-To: abuse@comcast.net X-Trace: rwcrnsc54 1066612112 24.34.139.183 (Mon, 20 Oct 2003 01:08:32 GMT) NNTP-Posting-Date: Mon, 20 Oct 2003 01:08:32 GMT Organization: Comcast Online Date: Mon, 20 Oct 2003 01:08:32 GMT Xref: archiver1.google.com comp.lang.ada:1160 Date: 2003-10-20T01:08:32+00:00 List-Id: chris wrote: > I tried instantiating Unchecked_Deallocation on Vehicle and not > Vehicle'Class not knowing you could do that. Sigh, I should have tried harder to get that notation fixed in Ada 83. Most of the time the Object name in an instantiation of Unchecked_Deallocation is a dummy parameter. Yes, there are cases where the size of the object being deallocated cannot be determined from the access type name, and the subtype of the Object type can be used by the compiler. But that only argues that there should be two versions of Unchecked_Deallocation, and the compiler should reject the one parameter version at compile time if it does need to use the designated subtype information. But that would IMHO be better than allowing users to instantiate with the "wrong" constrained subtype thinking it doesn't matter. Requiring the user to provide the "right" subtype when it doesn't matter--except that the compiler can reject a wrong value--is one of those "little tests" that Tucker used to talk about. > 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. It sounds like you are still doing more than you really have to. But I don't know understand your full design well enough to understand whether the explicit allocation and deallocation are necessary. But I assume that your "Proxy" notation indicates that you do need to use a pointer to the object rather than copying the object. -- Robert I. Eachus "Quality is the Buddha. Quality is scientific reality. Quality is the goal of Art. It remains to work these concepts into a practical, down-to-earth context, and for this there is nothing more practical or down-to-earth than what I have been talking about all along...the repair of an old motorcycle." -- from Zen and the Art of Motorcycle Maintenance by Robert Pirsig