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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,81bb2ce65a3240c3 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.125.233 with SMTP id mt9mr10507886pbb.5.1335570127611; Fri, 27 Apr 2012 16:42:07 -0700 (PDT) Path: r9ni106127pbh.0!nntp.google.com!news1.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: sbelmont700@gmail.com Newsgroups: comp.lang.ada Subject: Re: What would you like in Ada202X? Date: Fri, 27 Apr 2012 16:40:50 -0700 (PDT) Organization: http://groups.google.com Message-ID: <25142265.182.1335570050700.JavaMail.geo-discussion-forums@vbez18> References: <3637793.35.1335340026327.JavaMail.geo-discussion-forums@ynfi5> <13849842.838.1335485882969.JavaMail.geo-discussion-forums@vbai3> <134641.307.1335542673651.JavaMail.geo-discussion-forums@pbrx5> <2867357.127.1335561067669.JavaMail.geo-discussion-forums@ynee1> NNTP-Posting-Host: 206.53.78.59 Mime-Version: 1.0 X-Trace: posting.google.com 1335570127 16410 127.0.0.1 (27 Apr 2012 23:42:07 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 27 Apr 2012 23:42:07 +0000 (UTC) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=206.53.78.59; posting-account=ShYTIAoAAABytvcS76ZrG9GdaV-nXYKy User-Agent: G2/1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-04-27T16:40:50-07:00 List-Id: On Friday, April 27, 2012 7:18:34 PM UTC-4, Randy Brukardt wrote: > Note that Ada 95 did that (implicitly) for the Initialize/Adjust/Finalize= =20 > routines of type Controlled. We made that more explicit in Ada 2005, but= =20 > that did not reflect any language change. This is another example of a=20 > "hook". But this, along with the other hooks, seems like a relic of a single-inheri= tance version of Ada. A much (well, perhaps just slightly) better version = would be to split things up into multiple interfaces. For instance, instea= d of just extending Ada.Finalization and getting all three hooks regardless= , you split the three routines into three different one-subprogram interfac= es. Types extend exactly which ones they want, and not the ones they don't= . If you don't want Finalization or Initialization, then you only extend t= he Ada.Finalization.Adjustable (e.g.), and you no longer have usless subpro= grams being called to perform usless actions, and any mistakes (forgetting = to implement one, trying to implement another, etc) are caught at compile t= ime. Types get exactly what they ask for, and nothing they don't. Why lea= ve to a human what can be done by the compiler? -sb