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,672558c47d86bb1d,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!not-for-mail From: gate02@wrandyke.demon.co.uk (Michael Mounteney) Newsgroups: comp.lang.ada Subject: Hierarchy destruction in Ada Date: 12 Dec 2004 07:18:32 -0800 Organization: http://groups.google.com Message-ID: NNTP-Posting-Host: 80.176.143.194 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1102864713 24545 127.0.0.1 (12 Dec 2004 15:18:33 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 12 Dec 2004 15:18:33 +0000 (UTC) Xref: g2news1.google.com comp.lang.ada:6899 Date: 2004-12-12T07:18:32-08:00 List-Id: Ada 95 provides a mechanism with tagged and type'class to allow dynamic dispatch. So if one has: procedure something (O : basetype'class) is begin enact (O); end something; then as we all know, with the appropriate redefinitions of enact () for the subtypes of basetype, we have dynamic dispatch. But what about deallocation ? I want to declare: type handle is access all basetype; procedure dispose (ptr : in out handle); and can't see how to make this deallocate the correct object. Obviously, one can dynamically dispatch on ptr.all but it seems impossible to solve the complete problem without an unchecked conversion. Anyone ?