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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!attcan!uunet!husc6!bloom-beacon!tut.cis.ohio-state.edu!mailrus!ames!umd5!uflorida!novavax!hcx1!hcx9!brucej From: brucej@hcx9.SSD.HARRIS.COM Newsgroups: comp.lang.ada Subject: Re: Conditional compilation Message-ID: <94700004@hcx9> Date: 29 Jun 88 13:32:00 GMT References: <28254@clyde.ATT.COM> Nf-ID: #R:clyde.ATT.COM:28254:hcx9:94700004:000:1900 Nf-From: hcx9.SSD.HARRIS.COM!brucej Jun 29 09:32:00 1988 List-Id: djs@actnyc.UUCP states several objections to embedding conditional compliation within an Ada compiler: > I don't like the pragma approach as it is very hard to specify it within > the bounds of pragma legality. [RM references & explanation deleted] > Additionally, a significant conditional compilation facility requires a > meta-language of its own for definition and evaluation of conditions upon > which to include text into a compilation or not. [more deletions] > I am in favor of a distinct facility in the programming environment, like > a preprocessor, for doing file inclusion, conditional compilation, and > the like. Go ahead and standardize it, but don't force it into the Ada > compiler. Here at Harris, we discovered a need for conditional compilation when we first attempted to rehost and retarget the toolset we ship with our Ada compiler. Our approach was to create a preprocessor to perform that conditional compilation, and to implement code in the compiler to automatically invoke the preprocessor as needed. Ada source files have a `.a' suffix, while files in need of preprocessing have a `.pp' suffix. If the compiler's input file ends in `.pp' it first invokes the preprocessor ("a.pp foo.a"), and then compiles the `.a' file. Preprocessing as a separate pass is cheap and efficient. Invoking an expensive global optimizer to perform this function is overkill. Besides, the optimizer has more than enough to do anyways. While it would be presumptuous of me to propose that Harris' preprocessor syntax be standardized, I can at least point out the preprocessor's great value in allowing us to use a common set of source code for our Ada toolset for all of our different host/target combinations. We found a.pp so useful that we released it as part of our toolset. ---------- Bruce Jones brucej@hcx1.harris.com Harris Computers, Fort Lauderdale, FL