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-26 03:40:02 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.arcor-online.net!newsfeed01.sul.t-online.de!t-online.de!newsfeed.stueberl.de!newsr1.ipcore.viaginterkom.de!btnet-peer1!btnet-feed3!btnet!carbon.eu.sun.com!new-usenet.uk.sun.com!not-for-mail From: Ole-Hjalmar Kristensen Newsgroups: comp.lang.ada Subject: Re: Standard Ada Preprocessor (Was: why ada is so unpopular ?) Date: 26 Jan 2004 12:28:56 +0100 Organization: Sun Microsystems 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> <401268B4.1010704@noplace.com> NNTP-Posting-Host: khepri06.norway.sun.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: new-usenet.uk.sun.com 1075116536 22799 129.159.112.195 (26 Jan 2004 11:28:56 GMT) X-Complaints-To: usenet@new-usenet.uk.sun.com NNTP-Posting-Date: 26 Jan 2004 11:28:56 GMT User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:4805 Date: 2004-01-26T11:28:56+00:00 List-Id: >>>>> "MDC" == Marin David Condic writes: MDC> O.K. Can you think of *some* way for the *language* to specify MDC> redirection to an alternate body? That might fix most problems - if MDC> not all. (What do I do if I want alternative declarations in a spec to MDC> account for compiler differences?) What about allowing specialization of generic packages? Then you could have multiple bodies, the right one selected by the arguments to the generic instantiation. MDC> I suppose if we had some kind of "conditional with" we could construct MDC> a few more layers of indirection and provide alternate implementations MDC> that are picked up by the compiler. Some version of: MDC> with if (condition) Gnat_Solution ; MDC> with if (condition) Aonix_Solution ; MDC> and assuming that Gnat_Solution and Aonix_Solution have an identical MDC> interface (just different bodies) a similar "conditional use" in the MDC> right context would let you connect to the right thing. (They might MDC> not need identical interfaces - you might allow for differences in MDC> declarations so long as all the right identifiers were visible.) MDC> So then if you had a compiler specific package or some platform MDC> dependent thing, you'd hide it under some "skin" that provided a MDC> common interface. Withing and using the right "skin" would give you a MDC> portable way of handling the building of a system for two or more MDC> targets. (Assuming that the compiler didn't need to compile something MDC> conditionally withed just to be able to ignore the with.) MDC> MDC MDC> Pascal Obry wrote: >> I'm not sure I agree with that. Of course it will be a working >> solution but >> this is not a solution I'd like to see all over the place. Such feature will >> just encourage people to create messy code! >> I still prefer the one-spec and multiple bodies solution. At least >> the spec is >> target/hardware independent. This means that a good design needs to be >> done. Once this is done the selection of the right body depending on the >> target/hardware is a matter of configuration management. >> The argument saying that this solution make too much code >> duplication is >> wrong. It is perfectly possible to use child package/procedure/function for >> the one routine that is target/hardware dependant in whole API. >> Pascal. >> MDC> -- MDC> ====================================================================== MDC> Marin David Condic MDC> I work for: http://www.belcan.com/ MDC> My project is: http://www.jsf.mil/NSFrames.htm MDC> Send Replies To: m o d c @ a m o g MDC> c n i c . r MDC> "Face it ladies, its not the dress that makes you look fat. MDC> Its the FAT that makes you look fat." MDC> -- Al Bundy MDC> ====================================================================== -- C++: The power, elegance and simplicity of a hand grenade.