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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1f9be55dffd75804,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-09-27 10:12:55 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!news.tufts.edu!uunet!dca.uu.net!nyc.uu.net!ash.uu.net!xyzzy!nntp From: "Jeremy T. Smith" Subject: Export to a Namespace? X-Nntp-Posting-Host: 130.38.108.58 Content-Type: text/plain; charset=us-ascii Message-ID: <3D948F1F.9A87CE48@boeing.com> Sender: nntp@news.boeing.com (Boeing NNTP News Access) Content-Transfer-Encoding: 7bit Organization: The Boeing Company X-Accept-Language: en Mime-Version: 1.0 Date: Fri, 27 Sep 2002 17:02:23 GMT X-Mailer: Mozilla 4.73 [en]C-CCK-MCD Boeing Kit (Windows NT 5.0; U) Xref: archiver1.google.com comp.lang.ada:29384 Date: 2002-09-27T17:02:23+00:00 List-Id: I'm supporting a large mass of legacy Ada and my boss wants to add new functions using C++. There are about 2000 constants defined in the Ada code that we'll need visible to C++. Not a problem, a quick Perl script will add a pragma Export after each declaration. The values being exported are resolved at compile time, otherwise I'd just duplicat the declarations in C++. BUT, our system architect is a stickler about not polluting the global namespace, so can I export from Ada to a C++ namespace? Perhaps something like (though this won't compile on my Green Hills compiler): C++ Side: namespace My_Wrapper { extern int First_Val; extern int Next_Val; } Ada Side: First_Val : constant integer := Some_Withed_In_Named_Number; pragma Export(CPP, First_Val, "My_Wrapper::First_Val"); Next_Val : constant integer := First_Val'Succ; pragma Export(CPP, Next_Val, "My_Wrapper::Next_Val"); Any help would be much appreciated, even if it's just a "You can't do that"! Thanks Jeremy