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-27 10:04:51 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!zeus.visi.com!green.octanews.net!news-out.octanews.net!news-out.visi.com!petbe.visi.com!129.250.169.16.MISMATCH!pln-e!lotsanews.com!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: <400BD4B5.6000307@noplace.com> <400BDB7C.40100@noplace.com> <400D2150.6000705@noplace.com> <400E72F9.8060501@noplace.com> <100upo7ln5e3k59@corp.supernews.com> <400FC8E8.2040100@noplace.com> <_JSdna166JuxFo3dRVn-hg@comcast.com> <401115B7.5020205@noplace.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Tue, 27 Jan 2004 12:50:37 -0500 NNTP-Posting-Host: 198.96.223.163 X-Complaints-To: abuse@sympatico.ca X-Trace: news20.bellglobal.com 1075225785 198.96.223.163 (Tue, 27 Jan 2004 12:49:45 EST) NNTP-Posting-Date: Tue, 27 Jan 2004 12:49:45 EST Organization: Bell Sympatico Xref: archiver1.google.com comp.lang.ada:4916 Date: 2004-01-27T12:50:37-05:00 List-Id: Ole-Hjalmar Kristensen wrote: >>>>>>"JC" == Jeffrey Carter writes: > JC> Warren W. Gay VE3WWG wrote: > >> Jeffrey Carter wrote: > >>> One standard POSIX-Ada binding > >> Impossible. Some UNIces provide some API structure members, > >> while others don't, or provide something else again. Yes, > >> you can dumb it down to a "standard" (or omit non-universal > >> functionality), but by doing so you throw away functionality. > >> I find that unacceptable. > JC> There is a standard POSIX-Ada binding (Florist is an implementation of > JC> this standard) to the POSIX standard. If you want something not in > JC> this standard, obviously you're going to have to provide it yourself > JC> on some platforms. If you're on a platform that doesn't provide some > JC> of the functionality, then it's not a POSIX system. In neither case > JC> are you dealing with different versions of POSIX. > > Which does not matter if what you are doing is maintaining a program > which is running on multiple platforms and is compiled with multiple > compilers. The program has to run even if the platform does not > support a standard package like Florist. How many platforms is Florist > really available on, btw.? Listen, C programmers do this thing every day. "If some feature is available, then do it this way, else do 'it' in a more inferior way". Just because you write to "any platform", doesn't mean you have to dumb down the code for all platforms. If one O/S gives me an efficient way to do something, and I care to take advantage of this, then I can do just that with conditional compilation. By saying that an Ada program would never do that, has again condemned it to be inferior in some cases (which, IMO, is an entirely unnecessary limitation). > What matters is how do I do this while keeping the code readable and > maintainable. Of course! I could argue that conditional compilation may make it clearer where I'd run into portability problems on some platforms, because the different offending code is right in front of me (vs sitting somewhere else, unexplored). > One way to combat the combinatorial explosion of platforms * compiler > * library is to explicitly test for the features of the environment > you really need to know, not assume something because of a particular > platform/compiler. This is the approach typically used by projects > using the 'configure' tool. Yes, and that ./configure tool generates files that drive a conditional compile process. But no amount of Ada if statements can help you with conditionally with-ing certain packages, and conditional code that have to distinguish between the code that must work around differences and limitations, and deal with optional members of records etc. But this horse has been beaten to death already in this thread, and I see no reason to expand upon it again. > I would really like to have some standard configuration tool which > could take such parameters as input and produce a version of the > system tailored to the environment in which it is to be compiled and > run. This is just a high level statement of what has already been discussed. So how are you going to _implement_ this? 1. Preprocessing? 2. Conditional compilation? 3. Generate source code? The problem with #3 (which is what you seem to be suggesting) is that when there is a compile time problem, or a maintenance issue, you end up wanting to work with the generated files. BUT, you know you have to remember to work with the original INPUT files, that were used to generate it. #3 actually describes the gnatprep case, and there are options to make it easier to work this way (eg. an option that relates the line # back to the one in the original input file). But every once in a while, I end up modifying the wrong file by accident. I hate this. Conditional compilation would be a better solution for the developer because it is less error prone, and it is more natural. -- Warren W. Gay VE3WWG http://ve3wwg.tk