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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,7728b533f7ab5fb6 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!eweka.nl!lightspeed.eweka.nl!feeder.erje.net!news.musoftware.de!wum.musoftware.de!news.weisnix.org!newsfeed.ision.net!newsfeed2.easynews.net!ision!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Avoiding side effects Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: Date: Wed, 8 Oct 2008 09:35:43 +0200 Message-ID: NNTP-Posting-Date: 08 Oct 2008 09:35:38 CEST NNTP-Posting-Host: 861a83e6.newsspool1.arcor-online.net X-Trace: DXC=kf1S461NnLZ[7Non7UCi8Uic==]BZ:af^4Fo<]lROoRQFl8W>\BH3YRBkgRb;i]795RNh[ X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:8004 Date: 2008-10-08T09:35:38+02:00 List-Id: On Wed, 08 Oct 2008 05:16:22 GMT, Anders Wirzenius wrote: > "(see below)" writes: > >> On 07/10/2008 15:47, in article uprmc4g3i.fsf@no.email.thanks.invalid, >> "Anders Wirzenius" wrote: >> >>> "(see below)" writes: >>> >>>> On 07/10/2008 12:08, in article wvbrfxn8hdc7.fsf@sun.com, "Ole-Hjalmar >>>> Kristensen" wrote: >>>> >>>>> Yes, I think any program which use a read/write interface to a file >>>>> will have side effects in that sense. The only way I can think of for >>>>> avoiding this would be to mmap the whole file, then it will appear as >>>>> an array of bytes. >>>> >>>> Why would stepping through an array not be thought a "side" effect? >>> >>> A function that returns the row of that array and only that >>> would perhaps be a function without side effects. The information >>> in that row can be fetched when needed. >> >> A function that always returns the same row of an array would be of little >> use, I should think. > > I have a feeling that the function can be programmed so that it returns > different row (numbers, or pointers in that array) depending on > the content of the rows in that array ;-) ... which (content) cannot itself be a function, when mutable. There is no way out of "functional singularity." (:-)) Even a pure function is not a function in the promoted sense. It is a subroutine with one dedicated out parameter, called "result," such that all effect of execution is limited to that parameter. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de