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.3 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8002154d2966e1a1 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-04 22:49:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fr.usenet-edu.net!usenet-edu.net!enst.fr!not-for-mail From: "Grein, Christoph" Newsgroups: comp.lang.ada Subject: Re: Local vs global variables in ADA Date: Tue, 5 Nov 2002 07:42:28 +0100 (MET) Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-Trace: avanie.enst.fr 1036478943 70378 137.194.161.2 (5 Nov 2002 06:49:03 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Tue, 5 Nov 2002 06:49:03 +0000 (UTC) Return-Path: X-Authentication-Warning: mail.eurocopter.com: uucp set sender to using -f Content-MD5: Kub/SusSfD+QXveeJXiqOQ== X-Mailer: dtmail 1.2.1 CDE Version 1.2.1 SunOS 5.6 sun4u sparc Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.13 Precedence: bulk X-Reply-To: "Grein, Christoph" List-Unsubscribe: , List-Id: comp.lang.ada mail<->news gateway List-Post: List-Help: List-Subscribe: , Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:30372 Date: 2002-11-05T07:42:28+01:00 Martin Dowie: > The exception to this is "pragma Export" and "pragma Import". With these > you can do dangerous things and completely remove the need for > context clauses! :-) > > e.g. > > package body Foo is > ... > My_Local : Integer; > pragma Export (Ada, My_Local, "My_Local"); > ... > end Foo; > > ... > > -- WITHOUT "with Foo;" > -- > package body Bar is > ... > -- No idea where "My_Local" is actual declared! > -- > My_Other_Local : Integer; <-- could be any type here (if the size matches; if not, you'll suffer from nasal demons...) > pragma Import (Ada, My_Other_Local, "My_Local"); > ... > end Bar; and they need not even be of the same type. You can completely undermine the Ada type concept with this. As Martin said: it's "hideous"