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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!microsoft!johnro From: johnro@microsoft.UUCP (John Rogers) Newsgroups: comp.lang.ada Subject: Re: Questions on Ada... Summary: conditional compilation in Ada Message-ID: <6233@microsoft.UUCP> Date: 5 Jul 89 23:42:33 GMT References: <3034@wpi.wpi.edu> Distribution: usa Organization: Microsoft Corp., Redmond WA List-Id: Hi! There is another, more standard, way of doing conditional compilation in Ada. The original article had something like: #ifdef SOMETHING random_C_code; #endif In Ada, it's possible to have groups of statements that are never executed. For instance: procedure Example is Something : constant Boolean := True; -- change and recompile... begin if (Something) then random_Ada_Code; end if; end Example; If "Something" is set to False in some other environment, then the statements ("random_Ada_Code") will never be executed. The ANSI/MIL-STD for Ada allows this, and allows compilers to completely optimize out the code. This acts as a sort of conditional compilation. Unfortunately, this isn't a complete solution to the need for conditional compilation. There's no way to do this for data declarations, or "with" clauses, or various other things - just executable statements. Hope this helps...