From: Ole-Hjalmar Kristensen <ole-hjalmar.kristensen@substitute_employer_here.com>
Subject: Re: Avoiding side effects
Date: 07 Oct 2008 13:08:40 +0200
Date: 2008-10-07T13:08:40+02:00 [thread overview]
Message-ID: <wvbrfxn8hdc7.fsf@sun.com> (raw)
In-Reply-To: uljx1ncvt.fsf@no.email.thanks.invalid
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.
>>>>> "AW" == Anders Wirzenius <anders@no.email.thanks.invalid> writes:
<snip>
AW> Thanks for that, too. The program I wrote did the job and was
AW> sufficiently fast. My question was more about how to do it using
AW> subprograms (functions) without side effects.
AW> I suppose "Process records from..." and "Process tail..." are
AW> having side effects if coded as subprograms, as they advance the
AW> pointer in the two files.
AW> --
AW> Anders
--
C++: The power, elegance and simplicity of a hand grenade.
next prev parent reply other threads:[~2008-10-07 11:08 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-30 5:50 Avoiding side effects Anders Wirzenius
2008-09-30 7:48 ` Jean-Pierre Rosen
2008-09-30 9:20 ` Anders Wirzenius
2008-09-30 11:36 ` Jean-Pierre Rosen
2008-09-30 12:43 ` Anders Wirzenius
2008-09-30 10:42 ` Ludovic Brenta
2008-09-30 11:12 ` Anders Wirzenius
2008-10-02 12:56 ` Ole-Hjalmar Kristensen
2008-10-06 12:09 ` Anders Wirzenius
2008-10-07 11:08 ` Ole-Hjalmar Kristensen [this message]
2008-10-07 14:24 ` (see below)
2008-10-07 14:47 ` Anders Wirzenius
2008-10-07 14:51 ` (see below)
2008-10-08 5:16 ` Anders Wirzenius
2008-10-08 7:35 ` Dmitry A. Kazakov
2008-10-08 15:32 ` (see below)
2008-10-13 12:27 ` Anders Wirzenius
2008-10-13 13:21 ` Marco
2008-10-13 18:55 ` (see below)
2008-10-14 7:30 ` Dmitry A. Kazakov
2008-10-14 11:44 ` Colin Paul Gloster
2008-10-13 18:49 ` (see below)
2008-10-13 21:22 ` Adam Beneschan
2008-10-13 21:53 ` (see below)
2008-10-14 6:17 ` mockturtle
2008-10-14 14:58 ` Adam Beneschan
2008-10-14 6:22 ` Avoiding side effects and other dogma Anders Wirzenius
2008-10-14 13:48 ` (see below)
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox