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,634259facc42df7a X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!news.tele.dk!feed118.news.tele.dk!news.tele.dk!small.news.tele.dk!proxad.net!cleanfeed1-b.proxad.net!nnrp2-2.free.fr!not-for-mail Date: Thu, 06 Jul 2006 22:25:10 +0200 From: guillaume.portail@grospied.enanglais.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr-FR; rv:1.7) Gecko/20040616 X-Accept-Language: fr, en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Conditional compilation of debug traces without cpp References: <44aaae35$0$5389$626a54ce@news.free.fr> <44ac1562$0$10269$636a55ce@news.free.fr> <4ufi8e.ig7.ln@hunter.axlog.fr> In-Reply-To: <4ufi8e.ig7.ln@hunter.axlog.fr> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <44ad719c$0$5389$626a54ce@news.free.fr> Organization: Guest of ProXad - France NNTP-Posting-Date: 06 Jul 2006 22:25:00 MEST NNTP-Posting-Host: 82.228.125.157 X-Trace: 1152217500 nnrp2-2.free.fr 5389 82.228.125.157:33603 X-Complaints-To: abuse@proxad.net Xref: g2news2.google.com comp.lang.ada:5542 Date: 2006-07-06T22:25:00+02:00 List-Id: Jean-Pierre Rosen wrote: > Therefore yes, the *execution* of the call will always involve the > *evaluation* of the parameters (unless the compiler can prove that this > evaluation has no side-effects - like a call to a function declared in a > pure package). Ah yes, I just read LRM95-10.2.1(18), it seems to be what I want (I forgot this point). But Pure is applicable only to library units. And I need to apply it to functions of packages : package Data is type T is private procedure ... private type T is ... end; package Data.Image subtype T_String is String(...); function "+" (R : T) return T_String; ... end; - Data.Image."+" has really no side effect, but it cannot be declared Pure. Why ? The legality of such a pragma seems statically computable (the body of "+" should not access 'global' variables, etc). - "+" is located in its own package, where UI resources are grouped, as to facilitate their potential elimination/counting (all are named *.*...*.Image). -- Thierry Bernier