What's missing to make D2 feature complete?
via Digitalmars-d
digitalmars-d at puremagic.com
Mon Dec 22 15:25:11 PST 2014
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.
More information about the Digitalmars-d
mailing list