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 16:14:20 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: left-to-right (was In-Out Parameters for functions) Date: Fri, 27 Feb 2004 18:12:15 -0600 Organization: Posted via Supernews, http://www.supernews.com Message-ID: <103vn812hmbhm81@corp.supernews.com> References: <1075851506.238480@master.nyc.kbcfp.com> <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> 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:5913 Date: 2004-02-27T18:12:15-06:00 List-Id: "Stephen Leake" wrote in message news:mailman.25.1077857933.327.comp.lang.ada@ada-france.org... > Dmitry A.Kazakov writes: > > Right, the present situation is not good. But IMO the solution lies in > > introducing formally pure functions and imposing limitations on use of > > impure functions (and procedures with results) in expressions. > > That's way more work than simply requiring left-to-right, and > therefore far less likely to happen. I don't think we could allow the incompatibilities that would occur from banning side-effects in expressions. But a compiler could give a warning if it found such an expression or potentially such an expression (function calls to functions that aren't Pure or Pure_Function). That wouldn't be incompatible, and it would have the effect of detecting the problem when it happens. That seems like the most appropriate solution at this point. It's very similar to the way compilers warn about uses of uninitialized variables (another place where Ada chose the "unsafe" option for pragmatic reasons). One could imagine a compiler switch that turned these warnings into errors, so that at least disiplined developers could avoid problems. (GNAT can do this for some warnings, I know.) Randy.