On Mon, 22 Dec 2014 23:25:11 +0000
via Digitalmars-d <digitalmars-d@puremagic.com> wrote:

> On Monday, 22 December 2014 at 21:52:12 UTC, ketmar via 
> Digitalmars-d wrote:
> >> Thanks, I forgot that one. Immutable values by default is 
> >> indeed an important improvement. All by-value parameters to 
> >> functions should be immutable, period.
> >
> > but why? O_O
> 
> Because it is safer in long functions where you might miss a 
> modification of the input parameter when editing an existing 
> function, and copying from immutable to mutable is free if the 
> parameter is left alone after the copy.

i really really hate immutable integer args, for example, and can't
see any sense in doing it. that's why i wondered.

Attachment: signature.asc
Description: PGP signature

Reply via email to