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-23 09:49:15 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!zeus.visi.com!priapus.visi.com!orange.octanews.net!news.octanews.net!news-out.visi.com!petbe.visi.com!newspeer.monmouth.com!newsfeed.mathworks.com!wn14feed!worldnet.att.net!207.35.177.252!nf3.bellglobal.com!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail From: "Warren W. Gay VE3WWG" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Standard Ada Preprocessor References: <400BDB7C.40100@noplace.com> <400D2150.6000705@noplace.com> <400E72F9.8060501@noplace.com> <400FD4F7.8050805@noplace.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Fri, 23 Jan 2004 12:35:03 -0500 NNTP-Posting-Host: 198.96.223.163 X-Complaints-To: abuse@sympatico.ca X-Trace: news20.bellglobal.com 1074879251 198.96.223.163 (Fri, 23 Jan 2004 12:34:11 EST) NNTP-Posting-Date: Fri, 23 Jan 2004 12:34:11 EST Organization: Bell Sympatico Xref: archiver1.google.com comp.lang.ada:4728 Date: 2004-01-23T12:35:03-05:00 List-Id: Georg Bauhaus wrote: > Warren W. Gay VE3WWG wrote: > : MDC pointed out that you cannot conditionally do "with" > : as one example. > > Withing or not cannot be an option unless another possibly > related conditional requires a unit or not. > If there is no other conditional text, renaming an empty > package will do. Perhaps I don't understand your point here, but if I supply a parameter on the command line to the compiler that says I am compiling with GNAT (or PDcurses or whatever), then I can at compile time choose what packages I am going to "need". I don't find any reason to see prevent a conditional compile condition here. > : Implementation defined pragmas are > : another area of difficulty. Optional features are > : a pain to deal with since there is no way to feed > : values into a compile process (using make), > : without creating make "steps" that process the > : source code before hand (ie. this becomes a manual > : preprocessing step). > > So what is the greater pain? > To me, placing conditionals near the conditional sections is > tempting, but usually leads to #ifs all over the place. If you have #ifs all over the place, it is because you need them ;-) Granted much of this abuse on the C/C++ side is related to how C/C++ works in the first place. So drawing parallels to C should be done carefully. There is still a strong need for conditional compilation. Not for embedded work, since you have very specific targets for that code. But if Ada is to support the general purpose computing environment, and to support portability, it must have better facilities for the portability issues that come up. > It is > like writing tasking constructs without language support, or > like wrting your own dispatcher. If we had a way to declare for > any of the 2**N compilations which conditions are to be met, and > which parts of the program text have to be in place for one of the > compilations, configuration could be done in a systematic manner, > with the help of a computer program that does configuration checking, > and with a readable statement (declarative in style) of the programs > dependences. Tell me, how do you solve the situation where API call to your OS requires 3 parameters on one platform, and 2 on another? No if statement can solve that for you. -- Warren W. Gay VE3WWG http://ve3wwg.tk