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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Georg Bauhaus Newsgroups: comp.lang.ada Subject: Re: Any Suggestion How To Accomplish A Debug Macro? Date: Thu, 1 Jan 2015 12:28:34 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Thu, 1 Jan 2015 12:28:34 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="476081a394a6977aa9a16fe8c1d89e25"; logging-data="22492"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/d7/E+800sdTbLX0+risagWWYNm4t9xTE=" User-Agent: NewsTap/4.0.1 (iPhone/iPod Touch) Cancel-Lock: sha1:X0+RKDsoz/2uAYZ+c07diG/5EDQ= Xref: news.eternal-september.org comp.lang.ada:24308 Date: 2015-01-01T12:28:34+00:00 List-Id: "Randy Brukardt" wrote: > "Brad Moore" wrote in message > news:gCDow.832901$No4.618024@fx19.iad... >> On 14-12-30 04:14 AM, Simon Wright wrote: >>> Hubert writes: >>> >>>> I know there is no such thing as C #define's in Ada, but isn't there a >>>> way to make some sort of debug macro? >>>> In my C++ code I use a lot of statements like >>>> >>>> PRINT(DEBUG_CHANNEL, "TEXT" ); >>>> >>>> to print out debug messages and in release code, these defines aren't >>>> compiled. Is there any way to achieve something like this in Ada >>>> without surrounding it with an IF statement and a boolean flag? > > That's of course the Ada way. What's the point of avoiding the Ada way here? > Everything in Ada is more verbose than C -- some of us think that's the > advantage of Ada (more for readability than writability). The Ada way has been built into the Eiffel programming language: "debug" is a keyword of Eiffel and it works much like "begin" starts a block in Ada. Eiffel's "debug" is controlled by flag set at compile time, though.