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,dbcfe2b0a74da57e X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!news.glorb.com!newscon02.news.prodigy.net!prodigy.net!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Inherited Methods and such Date: Sat, 29 Sep 2007 19:58:00 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <1190296353.624737.150940@y42g2000hsy.googlegroups.com> <11m13st1f92kf$.m8s6y8mc8ebk.dlg@40tude.net> <1190321119.206313.65290@57g2000hsv.googlegroups.com> <1190408526.100291.265040@50g2000hsm.googlegroups.com> <9ukf2wtqjs0q$.iuijmal4x56b$.dlg@40tude.net> <1190497995.498679.119190@19g2000hsx.googlegroups.com> <1mw3qju08q8uj.sgzht7ld9ydc$.dlg@40tude.net> <1190579805.451187.71140@d55g2000hsg.googlegroups.com> <1i8ksr774bjbj.vpmnx3c0i9qz.dlg@40tude.net> <1190646125.024072.310020@19g2000hsx.googlegroups.com> <1r9s9v6pcjifl.vp4ktk0unpd1.dlg@40tude.net> <1190753631.240548.101820@19g2000hsx.googlegroups.com> <1190842629.099822.65770@g4g2000hsf.googlegroups.com> <1190927328.753361.138630@d55g2000hsg.googlegroups.com> <1191011579.746176.80370@o80g2000hse.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1191110281 3669 192.74.137.71 (29 Sep 2007 23:58:01 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sat, 29 Sep 2007 23:58:01 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:tXN14Ye6N7ncTwYajipf1phs2oE= Xref: g2news2.google.com comp.lang.ada:2232 Date: 2007-09-29T19:58:00-04:00 List-Id: Maciej Sobczak writes: > On 28 Wrz, 02:44, "Randy Brukardt" wrote: > >> > 1. I don't have to redispatch from Initialize, I can do this from >> > subprogram S1, which was called from S2, which was called from ... SN, >> > which was called from Initialize. >> >> Of course, that's why it can't be banned. But it is still wrong. It could be banned by a run-time check. It seems to me that could be implemented without distributed overhead: initially set the tag of the object to point to a dummy type descriptor, whose dispatch table entries all point to a "raise-exception" procedure. When construction is considered complete, set the tag to the real tag. But run-time checks are unsatisfying. I can't see how to do it at compile time without major violence to the Ada language design. >... I would go >> so far as to suggest that *calling out* from Initialize with an object of >> the type (or an ancestor) is wrong (with the single exception of calling a >> parent's Initialize routine). But that might be going too far. > > It might be good as a coding convention, though. I think forbidding "calling out" is going too far. One should always be allowed to wrap up some piece of code in a subroutine. (That's one reason I don't like accept statements -- they have to appear physically inside a task body, not inside a procedure called by the task body.) > BTW - your argument about covering this issue with education is > dangerous - someone might use it against you the next time anybody > criticizes "other" languages for being error prone... ;-) Indeed. But error-pronedness is relative. - Bob