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,34cc14b2a30b4c03 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nntp.club.cc.cmu.edu!feeder.erje.net!eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Wikibook on Ada Programming - Object Orientation Date: Thu, 08 Jul 2010 18:14:45 +0100 Organization: A noiseless patient Spider Message-ID: References: <4758a0b7-21f7-4a8e-97ec-d9468d5d598f@j4g2000yqh.googlegroups.com> <2dcc40df-72f1-443c-9afd-4415af4e63b9@k39g2000yqb.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Thu, 8 Jul 2010 17:14:47 +0000 (UTC) Injection-Info: mx01.eternal-september.org; posting-host="KCXegvZb5vh43D+f3BR6Ew"; logging-data="2303"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19/tkPiI0XnYJ3Ft0sPwU9rlFl+z2YYsI4=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (darwin) Cancel-Lock: sha1:k4UJ94uvBn2WSGm6+VOns4Hihg4= sha1:fRNVTIXcuDM2Gh4/343aZmZBYFM= Xref: g2news1.google.com comp.lang.ada:12269 Date: 2010-07-08T18:14:45+01:00 List-Id: Ludovic Brenta writes: > Right, I'm curious. I re-read sections on controlled types and mixin > inheritance in John Barnes' book but he leaves this entire problem as > an exercise to the reader (specifically, exercise 19.3). This seems > too complicated for a beginner. I've checked the answers, John was solving a simpler problem (to keep track of how many instances of a type have been created, and to give each a unique ID). Although he says that "[having] a component of a controlled type [...] will give the effect of controlling objects of [the containing type]" this won't result in the ability to fully support initialize/adjust/finalize.