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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,80155a886d197693 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!t21g2000yqi.googlegroups.com!not-for-mail From: sjw Newsgroups: comp.lang.ada Subject: Re: Conditional Compilation in Ada Date: Mon, 29 Jun 2009 13:02:32 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <5618a901-6b05-4a60-8362-7821261da50b@f19g2000yqo.googlegroups.com> <768c8117-d8af-4a04-b27e-2e74b69c1e8b@y17g2000yqn.googlegroups.com> <15ce8441-af38-4498-b3ed-c0517ad87dc6@x3g2000yqa.googlegroups.com> NNTP-Posting-Host: 82.20.239.89 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1246305752 11771 127.0.0.1 (29 Jun 2009 20:02:32 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 29 Jun 2009 20:02:32 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: t21g2000yqi.googlegroups.com; posting-host=82.20.239.89; posting-account=_RXWmAoAAADQS3ojtLFDmTNJCT0N2R4U User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7; en-us) AppleWebKit/530.18 (KHTML, like Gecko) Version/4.0.1 Safari/530.18,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:6727 Date: 2009-06-29T13:02:32-07:00 List-Id: On Jun 29, 7:00=A0pm, Chrono wrote: > Well, creating folders for each scenario is definitely not a better > solution than using a prep script, mainly in a project with high > complexity in its architecture. Even creating new packages for doing > this (or new variables which are going to be compiled with main code), > due to requirements restrictions. But thanks even though for all > responses. Gosh, how many scenario variables do you have? with how many options? I bet they don't actually affect that many actual code units, especially if structured the way Dmitry suggests. You could use alternately-named bodies: project T is type Environment is ("Real", "Simulated"); Env : Environment :=3D external ("ENVIRONMENT"); package Naming is case Env is when "Real" =3D> for body ("Target.Get_Position") use "target-get_position_real.adb"; when "Simulated" =3D> for body ("Target.Get_Position") use "target-get_position_simulated.adb"; end case; end Naming; end T; --S