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,38159b1b5557a2e7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-01-29 15:13:29 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-post-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Standard Ada Preprocessor Date: Thu, 29 Jan 2004 17:12:29 -0600 Organization: Posted via Supernews, http://www.supernews.com Message-ID: <101j4si8uc4taa0@corp.supernews.com> References: <400BDB7C.40100@noplace.com> <400D2150.6000705@noplace.com> <400E72F9.8060501@noplace.com> <100upo7ln5e3k59@corp.supernews.com> <400FC8E8.2040100@noplace.com> <4011127C.4030801@noplace.com> <101377e54car5cc@corp.supernews.com> <4017AAEF.1020304@noplace.com> <4018FF55.8030800@noplace.com> X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 X-Complaints-To: abuse@supernews.com Xref: archiver1.google.com comp.lang.ada:5067 Date: 2004-01-29T17:12:29-06:00 List-Id: "Simon Wright" wrote in message news:x7visiufpr5.fsf@smaug.pushface.org... > Marin David Condic writes: > > > 1) Have the two alternate lines in the same file & let the compiler > > decide (based on some condition) which to actually read & interpret. > > The point I was fumbling towards is that you now have _two_ > complicated things, probably: > > * the external autoconf or whatever setup that decides from the > environment whether some feature is present and sets the result in > environment variables, a config.h or a makefile; > > * and the source code that uses the condition. Right. There is no such thing as a compile-time solution that doesn't change some code or management artifact like build scripts. If you're using conditional compilation, you have to set the choice of which to use somewhere. You're going to have to manage that code or scripts with some form of configuration management per configuration. You cannot avoid this part of the problem on anything but the tiniest one-person projects (where you might actually be able to remember a bucket of special command-line switches - but as I get older, I find I can't even do that anymore...). So, given that you have a solution to the managment of separate code/build scripts, why would you not apply it to managing separate specs and bodies? And clearly, separate implementation-dependent code is always preferable (and don't forget that subunits also can be used to keep implementation-dependent stuff separate). There are cases where Ada's existing conditional compilation doesn't work (or makes the code much harder to read), but they're rare enough that going further is a very tough sell. Randy.