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-30 09:54:03 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed-west.nntpserver.com!hub1.meganetnews.com!nntpserver.com!newshosting.com!nx02.iad01.newshosting.com!news-feed01.roc.ny.frontiernet.net!nntp.frontiernet.net!tdsnet-transit!newspeer.tds.net!cyclone.bc.net!news.uunet.ca!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 (Was: why ada is so unpopular ?) References: <49cbf610.0401170627.79c3dfe5@posting.google.com> <400A9B48.3060100@noplace.com> <400BD4B5.6000307@noplace.com> <400BDB7C.40100@noplace.com> <400D2150.6000705@noplace.com> <400E72F9.8060501@noplace.com> <100upo7ln5e3k59@corp.supernews.com> <401118FD.701@noplace.com> <40126B5E.8050205@noplace.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Fri, 30 Jan 2004 12:39:45 -0500 NNTP-Posting-Host: 198.96.223.163 X-Complaints-To: abuse@sympatico.ca X-Trace: news20.bellglobal.com 1075484332 198.96.223.163 (Fri, 30 Jan 2004 12:38:52 EST) NNTP-Posting-Date: Fri, 30 Jan 2004 12:38:52 EST Organization: Bell Sympatico Xref: archiver1.google.com comp.lang.ada:5111 Date: 2004-01-30T12:39:45-05:00 List-Id: Robert I. Eachus wrote: > Marin David Condic wrote: > >> That works for some things, but it still will barf when a statement is >> compileable for one target but not for another. I'm thinking of a case >> where (for example) you can get one size of float for one target, but >> for another target that size is not allowed... > > I'm sorry, but to me this is heresy. Not that you might want to specify > a value for digits, I do that all the time. > > But when it matters enough to specify it, it is IMPORTANT. If a > particular compiler doesn't support that specification, there is no > point in trying to hide the problem. The application code I wrote won't > run in that environment. End of story. > > Well, not exactly end of story. There are cases where I write code that > uses IEEE extended precision if available, and when it is not uses IEEE > double with different algorithms and other methods of maintaining the > required precision, such as scaled (64-bit) integers. That code is so > different there is no point in trying to deal with it using ifdefs or > whatever. Two different matrix library bodies for the same > specification is the best I can do. Ah, but when you are writing code that must interface with 3rd party software, where at one version it uses a 16-bit value, and on other versions 32-bits etc., then you must make your Ada code match _it_. You look at the world as if everything conforms to your view within Ada. I'll agree, that this is the best way to have it. But when writing code that must compile against what the user has installed, whether it be a kernel release, or a shared library or version of a DLL, you must match what _they_have_ -- not what you'd like it to be. This is one area where trouble sets in. And what is even worse, you can configure your interface with the pragma Import(), and it will compile and link successfully. However, at _run_ time, you'll get undefined behavior if things don't agree. This is the impedance mismatch that you get between Ada and C (for example), and obviously something you try to minimize. -- Warren W. Gay VE3WWG http://ve3wwg.tk