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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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!news3.google.com!news.glorb.com!news.zanker.org!border2.nntp.ams.giganews.com!nntp.giganews.com!feeder.news-service.com!post.news-service.com!news1.surfino.com!not-for-mail Message-Id: <8483579.Pva1i1JzDe@linux1.krischik.com> From: Martin Krischik Subject: Re: This can't be done in Ada...or? Newsgroups: comp.lang.ada Reply-To: martin@krischik.com Date: Sat, 12 Feb 2005 15:58:52 +0100 References: <1108139611.709714.36170@o13g2000cwo.googlegroups.com> Organization: None User-Agent: KNode/0.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Complaints-To: abuse@surfino.com NNTP-Posting-Host: 83.169.148.166 (83.169.148.166) NNTP-Posting-Date: Sat, 12 Feb 2005 16:00:11 +0100 X-Trace: 6d1b3420e19fbf60c310329603 Xref: g2news1.google.com comp.lang.ada:8282 Date: 2005-02-12T15:58:52+01:00 List-Id: Duncan Sands wrote: >> The compiler can optimize away everything inside the "if >> Logging_Enabled". But it can't optimize away the evaluation of the >> parameters unless it can prove the absence of side effects. >> For example: >> >> Trace.Error(..., "Bad value of X " & Debug_Info(X)); >> >> where Debug_Info is some user-defined function that produces useful >> debug info about some complicated data structure called X. >> It has no side effects, but the compiler doesn't know that, usually. > > GNAT's pragma Pure_Function might help here. Is something like that > planned for Ada 2005? I heards rumors for "yes" but I could not confirm then. Maritn -- mailto://krischik@users.sourceforge.net Ada programming at: http://ada.krischik.com