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,d79d55198abf90d8 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2000-09-19 18:33:15 PST Path: supernews.google.com!sn-xit-02!sn-xit-01!supernews.com!newshub2.rdc1.sfba.home.com!news.home.com!news1.frmt1.sfba.home.com.POSTED!not-for-mail From: tmoran@bix.com Newsgroups: comp.lang.ada Subject: Re: Conditional Compilation References: <7FEFA9E5E3B3C4A5.90418F4BE7D5AE58.48E094CF81EC6BD3@lp.airnews.net> X-Newsreader: Tom's custom newsreader Message-ID: Date: Wed, 20 Sep 2000 01:33:14 GMT NNTP-Posting-Host: 24.20.190.201 X-Complaints-To: abuse@home.net X-Trace: news1.frmt1.sfba.home.com 969413594 24.20.190.201 (Tue, 19 Sep 2000 18:33:14 PDT) NNTP-Posting-Date: Tue, 19 Sep 2000 18:33:14 PDT Organization: @Home Network Xref: supernews.google.com comp.lang.ada:735 Date: 2000-09-20T01:33:14+00:00 List-Id: >Does ADA have an analog to the C language #define, #ifdef constructs >commonly used to include or exclude certain blocks of code in different >code versions? Since most good Ada compilers will do dead code elimination, an idiom for small include/exclude sections is: Debug_Version : constant boolean := True; ... if Debug_Version then ... -- stuff_for_debug_version else ... -- stuff_for_alternate_version end if; Since the truth/falsity of the constant Debug_Version is known at compile time and can't change, the compiler can include the desired code and eliminate the undesired. You could make a configuration package with no body and a spec consisting just of Debug_Version-like constant declarations if that was appropriate.