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,43aafc250d42730f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-02-09 11:45:57 PST Path: supernews.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!newsfeed.mesh.ad.jp!sjc-peer.news.verio.net!news.verio.net!sjc-read.news.verio.net.POSTED!not-for-mail Newsgroups: comp.lang.ada From: Brian Rogoff Subject: Re: controlled type in generic package? In-Reply-To: <3A83C58F.8D891740@bton.ac.uk> Message-ID: References: <3A7FDA9A.C667090F@stn-atlas.de> <95p2ab$463$1@nnrp1.deja.com> <95q1fa$9e$1@usenet.rational.com> <95rpj5$gq7$1@nnrp1.deja.com> <3A82A66D.49DE7EBD@bton.ac.uk> <87r919azac.fsf@deneb.enyo.de> <3A83C58F.8D891740@bton.ac.uk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Date: Fri, 09 Feb 2001 19:46:22 GMT NNTP-Posting-Host: 206.184.139.136 X-Complaints-To: abuse@verio.net X-Trace: sjc-read.news.verio.net 981747982 206.184.139.136 (Fri, 09 Feb 2001 19:46:22 GMT) NNTP-Posting-Date: Fri, 09 Feb 2001 19:46:22 GMT Organization: Verio Xref: supernews.google.com comp.lang.ada:5079 Date: 2001-02-09T19:46:22+00:00 List-Id: On Fri, 9 Feb 2001, John English wrote: > Florian Weimer wrote: > > It's just an ordinary mixin construction. Of course, there some > > syntactical overhead involved, but it's straightforward. > > Not hard to do, but annoying. A type declaration for the controlled > type, a separate type declaration for the derived type with a controlled > component added in, and if the controlled component's primitives need to > look at any components of the original record, some magic spells involving > access discriminants and view conversions. > > This might not bother you, but it feels like acrobatics and atrocities to me. > IMHO this is straightforward in the same sense as OOP in C is straightforward: > "It's just an ordinary pointer-to-array-of-functions construction. Of course, > there's some syntactical overhead involved, but it's straightforward." :-) Maybe even worse, since the OOP in C idiom is entirely explicit, whereas Controlledness has some implicitness about it. Oh well, I agree it's annoying, but I'm not even sure it's a misfeature. Any better ideas on a design for finalization, assuming you can't change Ada dramatically? -- Brian