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 Lines: 28 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...