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,c406e0c4a6eb74ed X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news1.google.com!news.glorb.com!proxad.net!freenix!oleane.net!oleane!skymaster!nobody From: Jean-Pierre Rosen Newsgroups: comp.lang.ada Subject: Re: ADA Popularity Discussion Request Date: Thu, 02 Sep 2004 16:38:43 +0200 Organization: Adalog Message-ID: References: <49dc98cf.0408110556.18ae7df@posting.google.com> <1198227.gWQ0keDDOY@linux1.krischik.com> <1093956169.632925@master.nyc.kbcfp.com> <4ic2hc.1q.ln@skymaster> <1093983432.462543@master.nyc.kbcfp.com> <1195965.KqRhyO6tpe@linux1.krischik.com> <1094132006.886791@master.nyc.kbcfp.com> NNTP-Posting-Host: mailhost.axlog.fr Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: s5.feed.news.oleane.net 1094137539 23195 195.25.228.57 (2 Sep 2004 15:05:39 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Thu, 2 Sep 2004 15:05:39 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr-FR; rv:1.7.2) Gecko/20040803 X-Accept-Language: fr-fr, en-us, en In-Reply-To: <1094132006.886791@master.nyc.kbcfp.com> Xref: g2news1.google.com comp.lang.ada:3262 Date: 2004-09-02T16:38:43+02:00 List-Id: Hyman Rosen a =E9crit : > This discussion started when JPR said > However, all other OO languages (that I know of) require > *all* classes to be declared at library level. >=20 > This is demonstrably untrue (unless JPR knows of neither C++ nor Java);= > Java and C++ do allow classes to be declared other than at library leve= l, > including inside functions. Neither C++ nor Java has Pascal-like block > structure, so these local classes interact more weakly with their > declaration environment than would be the case otherwise, but they are > nevertheless locally declared. Because of this weaker interaction, type= s > in C++ and Java do not have or need a lifetime, so they are global in > that sense, but not in a name lookup sense. >=20 > In C++, I can do > void f() { static int x; struct c { int f() { return x; } }; } They can be *declared* in functions, but they behave as globals. For=20 examples, I think (correct me if I'm wrong) that they cannot refer to=20 local parameters of the functions. They are global classes, whose=20 visibility is restricted to a function. --=20 --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr