Re: Standard Ada Preprocessor (Was: why ada is so unpopular ?)

From: Robert I. Eachus (rieachus_at_comcast.net)
Date: 01/24/04


Date: Sat, 24 Jan 2004 10:39:50 -0500

Marin David Condic wrote:

> I suppose if we had some kind of "conditional with" we could construct a
> few more layers of indirection and provide alternate implementations
> that are picked up by the compiler. Some version of:
>
> with if (condition) Gnat_Solution ;
> with if (condition) Aonix_Solution ;
>
> and assuming that Gnat_Solution and Aonix_Solution have an identical
> interface (just different bodies) a similar "conditional use" in the
> right context would let you connect to the right thing.

But again you are trying hard to make things difficult for yourself.
First, if the interface to Gnat_Solution and Aonix_Solution are
identical, why do you want to make source that uses the interface
compiler dependent? Both the Gnat and Aonix packages should be named
Solution. ;-)

Now that you have gone that far, you have banished all of the compiler
dependencies to the body of Solution. Either use the tricks I
described, or if the bodies are so different that it makes sense to
mantain them separately, provide them as separate files, and use
different makefiles for Aonix and Gnat. (Gnat likes to dictate the
names of files, but it does provide facilities for overriding that.)

-- 
                                           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


Relevant Pages

  • Re: Next Ada compiler for Debian: the votes so far
    ... The Debian changelog is specific to each package, ... AdaCore has not "gone proprietary", GNAT is, remains and will always ... > a compiler remained free). ... just not been provided to those who want to do proprietary software. ...
    (comp.lang.ada)
  • Re: GNAT verses A# for soft-realtime system
    ... I have a choice of GNAT or A# for my programming environment. ... Whether you go with a supported compiler, or with a free version of GNAT ... version of Ada you want to use. ... Do the additional features of 2005 target real-time systems? ...
    (comp.lang.ada)
  • Re: can one build commercial applications with latest gnat and other licenses related questions...
    ... "can I sell binaries without source code, if compiled with GNAT ... compiler runtime, which is licensed under the Gnu GPL, which requires ... I'll assume by 'gcc ada' you mean the official Free Software ... The gcc ada runtime has the GMGPL license, ...
    (comp.lang.ada)
  • Re: GNAT verses A# for soft-realtime system
    ... I have a choice of GNAT or A# for my programming environment. ... Whether you go with a supported compiler, or with a free version of GNAT ... version of Ada you want to use. ... Windows target but could also use .net on top of that. ...
    (comp.lang.ada)
  • Re: GNAT verses A# for soft-realtime system
    ... I have a choice of GNAT or A# for my programming environment. ... Whether you go with a supported compiler, or with a free version of GNAT ... version of Ada you want to use. ... Windows target but could also use .net on top of that. ...
    (comp.lang.ada)