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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,34257fd17abeba14 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!news2.google.com!news.germany.com!news.belwue.de!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: [SPARK] Code safety and information hiding Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <%%QFg.913090$084.629274@attbi_s22> <2SnGg.6629$aJ.3371@attbi_s21> Date: Mon, 21 Aug 2006 21:58:13 +0200 Message-ID: NNTP-Posting-Date: 21 Aug 2006 21:58:08 CEST NNTP-Posting-Host: a12c05eb.newsspool4.arcor-online.net X-Trace: DXC=9m32>=\I;S6i6K;>iZ]7634IUK\BH3Y2A;D_ZXH`LN:DNcfSJ;bb[5IRnRBaCdX`Qd62cS\e0Uh:Ye[IlHk1 X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:6302 Date: 2006-08-21T21:58:08+02:00 List-Id: On Mon, 21 Aug 2006 19:31:10 GMT, Jeffrey R. Carter wrote: > Maciej Sobczak wrote: >> >> It's interesting to see this discussion, especially after the posts >> revealing that it's not really clear what "global" means. > > We were discussing "true" global variables: variables in package > specifications. Packages have scope. Is a variable in the specification of a nested package "truly" global? Clearly, both "global" and "local" are relative to the given scope. The third possible status is "orthogonal" (exists in a sibling scope). >> Let's say I have a program composed of some subroutines or packages. >> Each subroutine has some local variables and each package has some state >> and together they all cooperate according to what the whole is supposed >> to do. >> Then I decide to break the system into separate processes, and for the >> sake of discussion what was a subroutine (or a package) originally >> becomes a separate process, all communicating using some form of IPC and >> still cooperating to achieve the supposed goals. > > Now each main subprogram that was a subprogram (Ada doesn't have > subroutines) in the original has its own local variables. Which are global relatively to the process, and local relatively to the distributed system as a whole. > Each main subprogram that was a package with state now has its own local > variables that contain that state. > >> The point is that while chopping the system into pieces, what was local >> (or state) variable originally became global in the resulting smaller >> program. Which is true without any chopping. Descending a hierarchy of scopes makes some things global without changing anything. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de