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 04:40:57 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!elnk-pas-nf1!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!stamper.news.atl.earthlink.net!newsread1.news.atl.earthlink.net.POSTED!d9c68f36!not-for-mail Message-ID: <4018FF55.8030800@noplace.com> From: Marin David Condic User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0 (OEM-HPQ-PRS1C03) 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> <100upo7ln5e3k59@corp.supernews.com> <400FC8E8.2040100@noplace.com> <4011127C.4030801@noplace.com> <101377e54car5cc@corp.supernews.com> <4017AAEF.1020304@noplace.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 29 Jan 2004 12:40:57 GMT NNTP-Posting-Host: 209.165.24.161 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.news.atl.earthlink.net 1075380057 209.165.24.161 (Thu, 29 Jan 2004 04:40:57 PST) NNTP-Posting-Date: Thu, 29 Jan 2004 04:40:57 PST Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: archiver1.google.com comp.lang.ada:5039 Date: 2004-01-29T12:40:57+00:00 List-Id: Well, let's sum it up this way: Its possible to have a given statement that works in environment A but not in B. For B you need an alternate statement. The decision has to be made at compile time because its the compiler that rejects the statement, so you can't wait until runtime and look at some configuration parameter to decide which statement to use. That leaves you with these choices: 1) Have the two alternate lines in the same file & let the compiler decide (based on some condition) which to actually read & interpret. 2) Build your own pre-processor because the compiler writers won't do the job in a standard way for you - but this is really no different than having the compiler decide. Its still indicating in the source code which line to compile. 2) Have the two alternate lines in two alternate files and let the build process decide which to actually send to the compiler. (Substitute the word "line" for "file" and you see the problem is identical - just using different mechanisms for which line to let the compiler try to interpret.) You aren't fundamentally changing the problem - just where it will be dealt with. If the argument against conditional compilation is that it will make ugly, incomprehensible code, then that same argument goes against the build process. It is, after all, some set of instructions that will be obeyed by the computer and hence a kind of programming language, so giving *it* the responsibility is just going to result in ugly, incomprehensible code at the build level. Only it won't be portable and you can't count on it being there and someone who doesn't know what's going on with the different bodies of code is likely to bugger it up. Not to mention the other related maintenance problems such as not having all the code relating to one specific conceptual function in one place - the "unnormalized database" situation described (I think) by Warren. So worrying about adding a feature that has the potential to be abused is, in my mind, a non-starter. The feature *will* be added *somewhere* so long as people have to manage code that must work in more than one environment. One camp says "Your life will be so much better if only you push that problem off to the build process level rather than the source code level." Another camp says "I've been there and done that and I think that at least some of the time, I'd rather deal with that problem at the source code level". The problem is inherently unpleasant no matter which way you go. But you *will* have to deal with it and IMHO, *sometimes* I want to deal with it at the source code level because it creates the fewest headaches for me. The fact that someone might abuse it is also a non-starter. People can abuse *anything* in a programming language. (Look at the religious wars over using something like the predefined type "Integer" - some think its handy and convenient and others think it is apostasy and should never be used at all under any circumstances. Yet its in the language and Ada programs are probably still better built on average than those in some other languages. Life goes on in an imperfect world.) MDC Simon Wright wrote: > > I'm probably missing the point here, but as I recall the C side of > things has a humungous incomprehensible heap of autoconf, m4, shell > scripts, GNU make only, imake .. people are happy enough with that, > where's the problem on the Ada side in selecting the right source file > variant? > > I've just added support for arrays to my UML-to-Ada generator, under > pressure. I _know_ I'm going to regret it, people are just bound to > decide to (eg) implement their own associations using them rather than > rely on the built-ins .. if you give people a bad feature they will > use it badly. Of course the market rules here, shame really .. > -- ====================================================================== Marin David Condic I work for: http://www.belcan.com/ My project is: http://www.jsf.mil/NSFrames.htm Send Replies To: m o d c @ a m o g c n i c . r "Face it ladies, its not the dress that makes you look fat. Its the FAT that makes you look fat." -- Al Bundy ======================================================================