Interested in D, spec confuses me.

Kagamin via Digitalmars-d digitalmars-d at puremagic.com
Wed Feb 3 04:12:03 PST 2016


On Wednesday, 3 February 2016 at 11:38:06 UTC, Bambi wrote:
> Immutable accomplishes nothing distinct here that I can see, 
> other than making the use of const confusing. To make a 
> function not change a value you declare a const input.

Immutablity provides stronger guarantee that allows more 
optimizations, e.g. reading the same immutable value is known to 
result in the same value so such repeated reading can be 
optimized out, in C such optimization is illegal, because const 
data can change over time.


More information about the Digitalmars-d mailing list