--- Comment #3 from Don <> 2009-10-13 06:06:14 PDT ---
(In reply to comment #2)
> Instead of introducing another inconsistency into the language for the
> not-so-common case, you could take the opposite route:
> pure int fun(int d, int divisor)
> {
>    immutable c = d;
>    int gun() pure { return c + 1; }
>    return gun() + d / divisor;
> }

I think the existing behaviour -- that you cannot change any of the parameters
in a pure function -- is simple and intuitive: pure functions can only modify
variables which they created themselves. A rule that pure nested functions can
use indirectly-referenced data, but cannot use parameters which are passed by
value, just seems complicated. 
Especially, in the case where a parameter contains a reference to other data,
it seems folly to be allowed to change part of the parameter, but not all of

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to