Re: Standard Ada Preprocessor

From: Dmitry A. Kazakov (mailbox_at_dmitry-kazakov.de)
Date: 01/28/04


Date: Wed, 28 Jan 2004 10:10:30 +0100

On Tue, 27 Jan 2004 16:41:50 -0500, "Warren W. Gay VE3WWG"
<warren@ve3wwg.tk> wrote:

>Randy Brukardt wrote:
>> "Warren W. Gay VE3WWG" <warren@ve3wwg.tk> wrote in message
>> news:ZwxRb.49242$Kg6.360396@news20.bellglobal.com...
>> ....
>>>I hate this. Conditional compilation would be a better
>>>solution for the developer because it is less error prone,
>>>and it is more natural.
>>
>> I couldn't disagree. Now, try to figure out a natural way to express such
>> conditional compilation in Ada. I can't (and I've tried to solve this
>> problem for 20 years.) If you don't have a non-ugly way to solve the
>> problem, the chances of anything being done about it are zero.
>
>I agree that an elegant solution should always be sought.
>Especially if you are looking at the far reaching consequences
>of "language changes". But if this problem has existed for
>20 years and no solution has come to light, then maybe it
>is time to consider a less elegant solution?

Conditional compilation is not less elegant it is disastrous. Ada
design is based on contracts. A conditional compilation contradicts to
this very principle. What kind of contract has Foo?

#if ...
procedure Foo (X : in out Integer);
#else
type Foo is record
   X : String;
end record;
#end if

IMO the solution is abstract packages.

--
Regards,
Dmitry A. Kazakov
www.dmitry-kazakov.de


Relevant Pages

  • Re: Standard Ada Preprocessor
    ... > I hate this. ... Conditional compilation would be a better ... > solution for the developer because it is less error prone, ... conditional compilation in Ada. ...
    (comp.lang.ada)
  • Re: Preprocessor Directives Management Tool
    ... Do you want it to remove only the #ifdef and #ifndef statements? ... you've indicated that the conditional compilation directives are the ... #ifdef FOO ...
    (comp.lang.c)
  • Re: Standard Ada Preprocessor
    ... Conditional compilation would be a better ... >>solution for the developer because it is less error prone, ... I agree that an elegant solution should always be sought. ... I don't think it is a matter of "no solution exists". ...
    (comp.lang.ada)
  • Re: Conditional compilation in Ada?
    ... conditional compilation and not a whole lot of sympathy for it with most ... people in the Ada crowd. ... If you were dealing with code ... have a problem because gnatprep isn't standard across all compilers. ...
    (comp.lang.ada)
  • Re: Standard Ada Preprocessor (Was: why ada is so unpopular ?)
    ... I'll always have to be adapting Ada code to these ... Until I get Ada bindings for all the C stuff out there, ... I will always be in need for "conditional compilation". ... I use Ada instead of the pre-processor for the case ...
    (comp.lang.ada)