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,34257fd17abeba14 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!130.59.10.21.MISMATCH!kanaga.switch.ch!news-zh.switch.ch!switch.ch!cernne03.cern.ch!cern.ch!news From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: [SPARK] Code safety and information hiding Date: Tue, 22 Aug 2006 14:42:26 +0200 Organization: CERN - European Laboratory for Particle Physics Message-ID: References: <%%QFg.913090$084.629274@attbi_s22> <2SnGg.6629$aJ.3371@attbi_s21> <9nAGg.13983$E02.5202@newsb.telia.net> NNTP-Posting-Host: abpc10883.cern.ch Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: sunnews.cern.ch 1156250545 21983 (None) 137.138.37.241 X-Complaints-To: news@sunnews.cern.ch User-Agent: Thunderbird 1.5.0.5 (X11/20060801) In-Reply-To: <9nAGg.13983$E02.5202@newsb.telia.net> Xref: g2news2.google.com comp.lang.ada:6315 Date: 2006-08-22T14:42:26+02:00 List-Id: Bj�rn Persson wrote: >> But I will argue that a variable which is visible everywhere in the >> program (in the sense that every executable piece of code can access >> this variable) is effectively global in that program > > Exactly. And if you have: > > package Pack is > procedure Piece_Of_Code; > end Pack; > > with Pack; > procedure Main_Subprogram is > Variable : Natural; > begin > Pack.Piece_Of_Code; > end Main_Subprogram; > > then Piece_Of_Code can't access Variable, so Variable isn't effectively > global, right? In this case right, although going down this path one could argue that there are no global variables at all, because for every such variable there exists at least one package (like Ada.Charaters), that cannot access it. :-) -- Maciej Sobczak : http://www.msobczak.com/ Programming : http://www.msobczak.com/prog/