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: a07f3367d7,5715319524adb794,start X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mail From: Oliver Kellogg Newsgroups: comp.lang.ada Subject: global package scope designator? Date: Mon, 5 Apr 2010 09:39:33 +0200 Organization: T-Online Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: news.t-online.com 1270453173 03 n12513 PhE4pI+18gyhMy6 100405 07:39:33 X-Complaints-To: usenet-abuse@t-online.de X-ID: XHQM-OZGYeVr1Vgm5bUGpn0zclA7fldTaKYGCftl9086Xg63fxGc6O User-Agent: Pan/0.133 (House of Butterflies) Xref: g2news2.google.com comp.lang.ada:10840 X-Original-Bytes: 1909 Date: 2010-04-05T09:39:33+02:00 List-Id: In C++, a leading "::" before a reference to a namespace denotes the global namespace. There does not seem to be an equivalent for this in Ada. I now ran into a situation where I felt this to be a lack. Here is an example (the original problem involved packages nested three levels deep which I reduced here to two levels for simplicity): -- File: gui.ads package gui is type Obj is new Integer; end gui; -- File: mcc.ads package mcc is end mcc; -- File: mcc-gui.ads package mcc.gui is function F return Natural; end mcc.gui; -- File: mcc-gui.adb with gui; package body mcc.gui is function F return Natural is begin return gui.Obj'Size; end F; end mcc.gui; $ gcc -c mcc-gui.adb $ mcc-gui.adb:6:17: "Obj" not declared in "gui" The package mcc.gui hides the library level package gui. In C++, we could write ::gui::obj to denote the desired namespace. Is this something that would be worth adding in a future revision of Ada? Thanks, Oliver P.S. For the original problem, see http://svn.savannah.gnu.org/viewvc?view=rev&root=rapid&revision=87