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!newsfeed00.sul.t-online.de!t-online.de!newsfeed.icl.net!newsfeed.fjserv.net!oleane.net!oleane!skymaster!nobody From: Jean-Pierre Rosen Newsgroups: comp.lang.ada Subject: Re: ADA Popularity Discussion Request Date: Wed, 01 Sep 2004 16:27:01 +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> <3hs3hc.ip8.ln@skymaster> 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 1094051098 3046 195.25.228.57 (1 Sep 2004 15:04:58 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Wed, 1 Sep 2004 15:04:58 +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: Xref: g2news1.google.com comp.lang.ada:3245 Date: 2004-09-01T16:27:01+02:00 List-Id: Georg Bauhaus a =E9crit : > Jean-Pierre Rosen wrote: > : Anyway, all objects are global in Java, so you cannot compare with Ad= a. >=20 > Uhm, in the following program, how is the object created by > "self.new Frob()" global? >=20 > class I { >=20 > private class Frob { > boolean foo() { return true; } > } >=20 > boolean q(Frob f) { return f.foo(); } >=20 > public static void main(String[] args) { > I self =3D new I(); >=20 > if (self.q(self.new Frob())) { // global? > return; > } > } > } >=20 It is on the heap, and can reference only other objects on the heap. There is therefore no issue of accessing non-existent variables. In Ada, you can declare an access type local to a subprogram. Objects=20 created by allocators for this access type will similarly be accessible=20 only from within the subprogram. They are still global. --=20 --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr