On 04/09/2013 01:26 PM, Manu wrote:
On 9 April 2013 20:50, Timon Gehr <[email protected]
<mailto:[email protected]>> wrote:
On 04/09/2013 12:28 PM, Manu wrote:
...
There's nothing 'pure' about a function that has side effects.
If it has the same side effects every time it is called with the
same arguments, then there is something pure about it.
But it doesn't. It could do anything when called a second time, same
arguments or not.
Well, no. That's the point.
Feel free to provide an example where you think this property is violated.
(However, note that the concept of the 'same arguments', and the 'same
side effects' is informal and would need a little clarification.)
The only thing it can't do is escape a variable. That sounds more like
'scope' to me than 'pure'.
That is not the only thing it can't do.