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,a00006d3c4735d70 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-02-27 15:38:19 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: In-Out Parameters for functions Date: Fri, 27 Feb 2004 17:37:42 -0600 Organization: Posted via Supernews, http://www.supernews.com Message-ID: <103vl77rdlmbb25@corp.supernews.com> References: <4020C947.81A6D703@0.0> <1075907239.138068@master.nyc.kbcfp.com> <402232E9.3EE15B4B@0.0> <1075987360.225622@master.nyc.kbcfp.com> <40236C0B.E988E003@0.0> <1077634311.254581@master.nyc.kbcfp.com> <82347202.0402251405.2db2f3c5@posting.google.com> <1077747598.55635@master.nyc.kbcfp.com> X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 X-Complaints-To: abuse@supernews.com Xref: archiver1.google.com comp.lang.ada:5910 Date: 2004-02-27T17:37:42-06:00 List-Id: "Vinzent 'Gadget' Hoefler" wrote in message news:t9fr30tnl8rh0ain01qeqq17ottovqdso3@jellix.jlfencey.com... ... > So it might be possible that in the parsing/compiling process the > order specified in the named notation simply gets reordered to the > order of how the parameters are declared. Right. That's exactly what Janus/Ada does internally for named notation, and the arguments are evaluated in the order that they get passed; no matter what order they were passed in. > IMO, it is easier to just not rely on side-effects. No side-effects, no problems. Which was the basic idea behind Pure - a way to declare that functions have no meaningful side effects. (Caching values and records calls in a scratchpad aren't meaningful). It's unfortunate that applying the "Pure" categorization is so difficult. GNAT provides a solution here - pragma Pure_Function - which essentially declares to the compiler that the function has no meaningful side effects without any checks. (This pragma is being considered for Ada 200Y.) One could imagine a coding standard which required all functions used in non-trivial expressions (that is, not used alone) to be marked either Pure or Pure_Function. Randy.