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,69044da3235a8817,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-09-27 08:01:09 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!news-out.cwix.com!pullfeed!newsfeed.cwix.com!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!freenix!jussieu.fr!cnam.fr!not-for-mail From: Sami Evangelista Newsgroups: comp.lang.ada Subject: parameters evaluation Date: Fri, 27 Sep 2002 16:55:45 +0200 Organization: Conservatoire National des Arts et Metiers Message-ID: <3D947171.2040909@wanadoo.fr> NNTP-Posting-Host: lmi14.cnam.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: kelvin.cnam.fr 1033138340 7569 163.173.228.14 (27 Sep 2002 14:52:20 GMT) X-Complaints-To: usenet@news.cnam.fr NNTP-Posting-Date: 27 Sep 2002 14:52:20 GMT User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.4) Gecko/20011126 Netscape6/6.2.1 X-Accept-Language: en-us Xref: archiver1.google.com comp.lang.ada:29376 Date: 2002-09-27T14:52:20+00:00 List-Id: hello all i have noticed a strange thing about expressions evaluations during a procedure or function call. it appears that the parameters are evaluated in the "wrong" order. Try this ------------------------------------------------------------- with ADA.TEXT_IO; use ADA.TEXT_IO; procedure Proc is function F return Boolean is begin Put_Line("F"); return True; end; function G return Boolean is begin Put_Line("G"); return True; end; function H(B1, B2 : in Boolean) return Boolean is begin put_Line("H"); return True; end; begin if H(F, G) then null; end if; end; ------------------------------------------------------------- the output should "logically" be F G H but it is G F H so be careful if your functions change global variables or have others effects which is by the way not very clean. Sami Evangelista