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 X-Google-Thread: 103376,38159b1b5557a2e7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-01-29 03:17:58 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsmi-us.news.garr.it!newsmi-eu.news.garr.it!NewsITBone-GARR!newsserver.cilea.it!news.crs4.it!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Re: Standard Ada Preprocessor (Was: why ada is so unpopular ?) Date: 29 Jan 2004 12:17:55 +0100 Organization: CRS4, Center for Adv. Studies, Research and Development in Sardinia Message-ID: 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> <400FC8E8.2040100@noplace.com> <_JSdna166JuxFo3dRVn-hg@comcast.com> <401115B7.5020205@noplace.com> <401264ED.306@noplace.com> <4012927F.60401@noplace.com> NNTP-Posting-Host: sparre.crs4.it Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: pietro.crs4.it 1075373917 9401 156.148.70.170 (29 Jan 2004 10:58:37 GMT) X-Complaints-To: news@nntpserver.crs4.it. NNTP-Posting-Date: 29 Jan 2004 10:58:37 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:5034 Date: 2004-01-29T10:58:37+00:00 List-Id: Marin David Condic wrote: > Yeah. Isolating them down at some low level is fine. But that still > leaves you with the problem of "How do I code up the stuff at the > low level?" You're either controlling it with some kind of build > scripts & CM or you do it with something inside the language. Given > that it needs to be done & I can't keep pushing it off with > indirection forever, I'd like a language mechanism for doing it. Would a pragma in the package specification declaring which file the package body should be read from depending on some compilation parameters (compiler, operating system, etc.) do the job? Something like this, where the body is grabbed from the file named by the first "Body_Source_File" pragma with a matching condition. If no "Body_Source_File" pragma has a matching condition, the compiler just uses its default routine for finding the source code for the package body. with System; with System.Compiler_Flags; package Hiding_Compiler_Specific_Details is pragma Body_Source_File (Condition => System.Compiler_Name = "GNAT", File => "GNAT/HCSD.ada_body"); pragma Body_Source_File (Condition => System.Compiler_Flags.Set ("--with-gnu-gettext"), File => "GNU-Gettext/HCSD.ada_body"); pragma Body_Source_File (Condition => True, File => "default_implementations/HCSD.ada_body"); ... end Hiding_Compiler_Specific_Details; This would limit the language handling of conditional compilation to selecting package/unit bodies, but I think it would solve most of the problems mentioned in this discussion, without risking the whole preprocessing hell seen in too many C programs. Greetings, Jacob -- �But you have to be a bit wary of a ship that collects snowflakes.� -- Diziet Sma