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-23 05:39:35 PST Path: archiver1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!tar-atanamir.cbb-automation.DE!not-for-mail From: Dmitry A. Kazakov Newsgroups: comp.lang.ada Subject: Re: Standard Ada Preprocessor (Was: why ada is so unpopular ?) Date: Fri, 23 Jan 2004 14:46:59 +0100 Message-ID: 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> NNTP-Posting-Host: tar-atanamir.cbb-automation.de (212.79.194.116) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de 1074865174 21908113 212.79.194.116 ([77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:4711 Date: 2004-01-23T14:46:59+01:00 List-Id: On Fri, 23 Jan 2004 12:24:31 GMT, Marin David Condic wrote: >That's why much as I might find some kind of preprocessing distasteful >and certainly don't want to watch it degenerate into the unholy mess >that you have with C, I think we need *some* mechanism for conditional >compilation. > >Those who argue that it should all be isolated with different package >bodies have to address the fact that a) this is often difficult or >impossible ... different bodies which are not necessarily packages. If smaller units required there are subroutines for that. > and b) it implies some kind of configuration management or >build utilities that are totally outside the scope of the language and >may not exist. But the language defines the notion of a library. If we could extend it in a way allowing selection of a child units path during compilation, then I believe, it could be 80% of the issue. >I'd like to be able to hand off a collection of source code and say >"This is the main program - just compile it from there on your >machine..." If it involves different bodies, I've got to provide you >with detailed build instructions and can't assume you've got the same >tools as I do. All that gets fixed automagically if I could put some >conditional compilation statements into the code that indicate which way >to go based on some kind of directive to the compiler. (I don't trust >something in the package System to be sufficient - that at best can only >tell you about the compiler, but not necessarily about the external >platform and its potential variations.) If we could limit variations to compilation units, I think we could, then there might be a better way than preprocessing. We could invent some sort of abstract packages [units], providing some interface (types, values, procedures) without any implementation. So types and constants could be declared incomplete there. Then a set of normal compilation units could provide various platform/condition-specific implementations of an abstract unit. Using such an unit in "with", "use" etc should select an implementation at compile-time from the set of visible concrete units. That would be some sort of polymorphic compilation units. -- Regards, Dmitry A. Kazakov www.dmitry-kazakov.de