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-Thread: 103376,400766bdbcd86f7c X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!o13g2000cwo.googlegroups.com!not-for-mail From: "Per Lindquist" Newsgroups: comp.lang.ada Subject: Re: This can't be done in Ada...or? Date: 14 Feb 2005 00:49:52 -0800 Organization: http://groups.google.com Message-ID: <1108370992.840089.101380@o13g2000cwo.googlegroups.com> References: <1108139611.709714.36170@o13g2000cwo.googlegroups.com> NNTP-Posting-Host: 138.14.239.132 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1108370997 9361 127.0.0.1 (14 Feb 2005 08:49:57 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 14 Feb 2005 08:49:57 +0000 (UTC) In-Reply-To: User-Agent: G2/0.2 Complaints-To: groups-abuse@google.com Injection-Info: o13g2000cwo.googlegroups.com; posting-host=138.14.239.132; posting-account=e84-wQ0AAADeDLnjH5yWqnRMVsJLfQJg Xref: g2news1.google.com comp.lang.ada:8308 Date: 2005-02-14T00:49:52-08:00 List-Id: >But it can't optimize away the evaluation of the >parameters unless it can prove the absence of side effects. This is actually the main reason for the post. Jeff's suggestion is the direction we were heading for but the parameter evaluation made it somewhat unsufficient. >But then you have to write two versions of Debug_Info >for every type. So I'd say the original poster's statement, >"it can't be done in Ada" is pretty true, if zero run-time overhead >is required. > >In my code, I usually do as you suggested, but *also* add "if >Logging_Enabled" or whatever around calls if the parameter evaluation >could be expensive. This provides *almost* what the original poster >asked for -- you need the annoying "if Logging_Enabled" only sometimes. OK, maybe this is the way we must go... Thanks for confirming.