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,FREEMAIL_FROM, T_FILL_THIS_FORM_SHORT autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.66.20.100 with SMTP id m4mr3267127pae.36.1386365273615; Fri, 06 Dec 2013 13:27:53 -0800 (PST) X-Received: by 10.49.94.110 with SMTP id db14mr70172qeb.27.1386365273557; Fri, 06 Dec 2013 13:27:53 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.linkpendium.com!news.linkpendium.com!news.snarked.org!newsfeed.news.ucla.edu!usenet.stanford.edu!i10no2650741pba.1!news-out.google.com!p7ni11401qat.0!nntp.google.com!p15no8649606qaj.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 6 Dec 2013 13:27:53 -0800 (PST) In-Reply-To: <52a2382a$0$7939$2c885b36@post.eweka.nl> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=75.161.11.227; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 75.161.11.227 References: <52a0de7e$0$23162$2c885b36@post.eweka.nl> <2Kiou.15508$bz3.2509@fx24.fr7> <52a2382a$0$7939$2c885b36@post.eweka.nl> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <4152aa2a-ad91-4cac-a5ad-30f6e7544647@googlegroups.com> Subject: Re: Exclude parts of a package From: Shark8 Injection-Date: Fri, 06 Dec 2013 21:27:53 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: news.eternal-september.org comp.lang.ada:17882 Date: 2013-12-06T13:27:53-08:00 List-Id: On Friday, December 6, 2013 1:48:43 PM UTC-7, Felix Krause wrote: > > This is an interesting approach, but in my case, that would lead to > massive code duplication because I don't really have child packages to > choose from (same goes for having multiple spec files). I rather need > to add or exclude subroutines of one package. Moving it to a child > package will not work because it needs to be a primitive operation of a > tagged type defined in the original package. Easy enough solution: 1) Define everything [all of OpenGL, or at least portion-X (X : Types, Functions, etc)] in one big package; for the current version (4.3, IIRC).* 2) Define version-packages which repeat the spec of the appropriate functions and use renames in their body. 3) Use the rename technique given by Brian. Ex: -------------------------------------------------- Package Main_Stuff is Procedure Bob; -- Introduced in v.1. Procedure Tim; -- Introduced in v.1.2. Procedure Dave; -- Introduced in v.1.3. Procedure Bill; -- Introduced in v.1.3. private -- Stubs, to avoid having to provide a body. Procedure Bob is null; Procedure Tim is null; Procedure Dave is null; Procedure Bill is null; end Main_Stuff. -- Def v.1. private with Main_Stuff; Package Stuff_1_1 is Procedure Bob; private Procedure Bob renames Main_stuff.Bob; end Stuff_1_1; -- Def v.1.2. private with Main_Stuff; Package Stuff_1_2 is Procedure Bob; Procedure Tim; private Procedure Bob renames Main_stuff.Bob; Procedure Tim renames Main_Stuff.Tim; end Stuff_1_2; ---- Brian's renaming trick: with Stuff_1_2; package Stuff renames Stuff_1_2; ---- Client code: with Stuff; procedure Do_Stuff is --.... ------------------------------------------------------------------- * In my OpenGL binding TAO-GL my plan was/is similar to this except the bingings query opengl for parameters and build the types from the results (ie NUMBER_OF_LIGHTS) via generic instantiation, then that would instantiate the functions (ensuring the functions) are not called w/ inappropriate parameters. * TAO-GL: https://github.com/OneWingedShark/TAO-GL NOTE: GitHub version at the state *before* I decided to make the Functions package generic.