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.5 required=5.0 tests=BAYES_00,INVALID_MSGID, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,2308afbbe4ecec0b X-Google-Attributes: gid103376,public From: "Jean-Pierre Rosen" Subject: Re: Subverting 'Access for Sub-programs Date: 1999/08/06 Message-ID: <7of9eq$2ue$1@wanadoo.fr>#1/1 X-Deja-AN: 509676582 References: <7ocqru$rrm$1@nnrp1.deja.com> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 X-Complaints-To: abuse@wanadoo.fr X-Trace: wanadoo.fr 933964058 3022 164.138.107.69 (6 Aug 1999 18:27:38 GMT) Organization: Adalog X-MSMail-Priority: Normal NNTP-Posting-Date: 6 Aug 1999 18:27:38 GMT Newsgroups: comp.lang.ada Date: 1999-08-06T18:27:38+00:00 List-Id: Ray Blaak a �crit dans le message : m3iu6tjw2d.fsf@vault83.infomatch.bc.ca... > Robert Dewar writes: > > But it is pretty fundamental and obvious that a tagged type > > cannot be extended in a temporary inner scope, no? > > It is not fundamental and obvious to me. Perhaps you could explain. > > I am aware of implementation concerns with allowing such a thing, but the > restriction seems is an exception to the generality of declaring Ada > constructs that is usually allowed. > > One can declare types, exceptions, variables, and routines anywhere, except for > tagged types. This restriction prevents a completely localized programming > style when doing OO stuff. > Remember that tagged types basically include an array of pointers to subprograms, so the restrictions on tagged types are the same as those on pointers to subprograms. I find it a bit unfair to blame Ada for these restrictions. C++, Eiffel, Java have no embedded subprograms. Turbo-Pascal with objects (I gave up with Turbo-Pascal before it became Delphi, but I guess it is the same for Delphi) allows classes only at the top level. In all these case, there is no issue since everything MUST be global. Ada's restriction is that derivations must occur at the same level as the parent type, while other languages force derivations only at level 1. So Ada is actually more liberal than other OO languages I know of. You may regret that Ada is not even more liberal, but please consider that the situation is better than other languages. -- --------------------------------------------------------- J-P. Rosen (Rosen.Adalog@wanadoo.fr) Visit Adalog's web site at http://perso.wanadoo.fr/adalog