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,ce0900b60ca3f616 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-07 03:54:39 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: dewar@gnat.com (Robert Dewar) Newsgroups: comp.lang.ada Subject: Re: Lazy Evaluation [Side-Effects in Functions] Date: 7 Nov 2001 03:54:38 -0800 Organization: http://groups.google.com/ Message-ID: <5ee5b646.0111070354.55494ec2@posting.google.com> References: <9s230d$107b5a$2@ID-25716.news.dfncis.de> <5ee5b646.0111040507.5ca7ea23@posting.google.com> <9s3tl3$111hco$1@ID-25716.news.dfncis.de> <5ee5b646.0111041846.93f3e07@posting.google.com> <9s5eub02j61@drn.newsguy.com> <3be666fe.6426140@News.CIS.DFN.DE> <9s7bfb$11boa1$1@ID-25716.news.dfncis.de> <3be7a31d.1736453@News.CIS.DFN.DE> <9s941c$11mrei$2@ID-25716.news.dfncis.de> <5ee5b646.0111061942.3fa463fb@posting.google.com> <3BE8BBC2.A8563DBD@san.rr.com> NNTP-Posting-Host: 205.232.38.14 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1005134079 3084 127.0.0.1 (7 Nov 2001 11:54:39 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 7 Nov 2001 11:54:39 GMT Xref: archiver1.google.com comp.lang.ada:15984 Date: 2001-11-07T11:54:39+00:00 List-Id: Darren New wrote in message news:<3BE8BBC2.A8563DBD@san.rr.com>... > Robert Dewar wrote: > > Of course there is no particular conflict between side > > effects and call by name, as anyone who has programmed > > in Algol-60 extensively is perfectly aware. > > Uh, unless you do something like > Swap(A(I), I) > (where A is an array, of course) Well yes, we all know Algol-60! (or at least I hope any serious student of programming languages does). But there is no special problem here. In Algol-60, the effect will be canonical, depending on the exact order of statements in the body. Sure, it might not do what the programmer expects in this case, but it will do EXACTLY what the programmer programmed. No language can avoid this discrepancy in all cases. Are you arguing that in practice call-by-name is troublesome for this reason? I think that's a bogus argument. I certainly never found it to be the case in my Algol-60 programming days, how about you? Note that in Ada, simple out parameters generate similar concerns, except that the result is *not* canonical, if you do x (m.m) when x has two out parameters, the order in which things get assigned is undefined in Ada.