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,FREEMAIL_FROM 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-26 08:03:38 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!elnk-pas-nf1!newsfeed.earthlink.net!pd7cy1no!shaw.ca!border1.nntp.ash.giganews.com!border2.nntp.sjc.giganews.com!border1.nntp.sjc.giganews.com!nntp.giganews.com!local1.nntp.sjc.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Mon, 26 Jan 2004 10:03:25 -0600 Date: Mon, 26 Jan 2004 11:03:23 -0500 From: "Robert I. Eachus" 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: <401272E3.4040506@noplace.com> <8LzQb.12619$U%5.77885@attbi_s03> <4012D932.9010509@noplace.com> <4013F11E.4030700@noplace.com> In-Reply-To: <4013F11E.4030700@noplace.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 24.147.77.160 X-Trace: sv3-lKWSBTuk27zerMh8/0pVoWqYtVXMS6HuwiW1Ni3I2kpch0dpm9ZLJOGGa3DFrv5KGvEI2y/chLHU2qk!iitKekj11BnDSAvr4cn1ddKKlp2yDWKoBLkgYyX+V+7WBDJRBNq8tV8fnPZkwQ== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Xref: archiver1.google.com comp.lang.ada:4820 Date: 2004-01-26T11:03:23-05:00 List-Id: Marin David Condic wrote: > I'm not talking about addresses. Have you never seen a rep clause on a > record, for example, that a given compiler will refuse to accept even if > it is syntactically legal? I don't happen to have one sitting in my back > pocket at the moment, but I *know* I've coded up valid rep clauses on > records that compilers have spit out and refused to accept. Technically, > it is legal for an implementation to refuse just about any rep clause it > doesn't want to be bothered with - so perhaps you've got it coded up one > way for one compiler and another way for another compiler. > > Perhaps there's some arcane trick that can be pulled to change rep > clauses on a record on the fly, but I've not seen it (and it sure starts > sounding *far* more complex than decrypting a simple conditional > compilation directive - maybe this is what frustrates me about the > opposition to a conditional compile: Everyone holds out some cumbersome, > complex, arcane trickery that is orders of magnitude more difficult to > understand and utilize properly as an answer in order to avoid something > that is capable of being pretty simple & basic.). What I *have* seen is > rep clauses that a compiler refuses to accept - and hence I can't even > *get* to runtime because I've got compile errors. Legal or not - Moral > or not - I still have to get a job done and a conditonal compilation > directive of some sort would fix the problem. Sigh, if you want to win the debate, fine, but I can't help you. If you want to have an easier time of it when writing implementation dependent code, pay attention. My point is not that I have a magic wand that can be waved over your program to reduce the amount of implementation code to zero. My point is that if you are willing to do things the Ada way instead of the C way, the number of system dependent files becomes very small. It would be nice if you could write your code so that all of the that code depended on System, so you didn't need to maintain multiple versions. To some extent that is a bug in the language that we discussed in this thread. (Implementations where System.Name is useless.) What I am trying to say, is use these techniques, and you will end up with one or two files that need to be changed when porting. If you want to use a preprocessor to maintain that file, fine. Many Ada compilers actually supply one, or you can use cpp. Personally my style is to provide a "generic" version and to expect those who port the code to tailor it. Optimally, that file contains only a package body, but doing that requires going to extremes you might not like. Just to give one example, You might define two interfaces for some OS calls and choose which one to use every time the interface is called. This requires that the code that calls them, and the parameters passed, are in a nested scope. This often adds extra overhead to system calls. Worth it? You choose. But putting all the system dependent cruft in one compilation unit in my experience, should be automatic. -- Robert I. Eachus "The war on terror is a different kind of war, waged capture by capture, cell by cell, and victory by victory. Our security is assured by our perseverance and by our sure belief in the success of liberty." -- George W. Bush