Why immutable ?
Simen kjaeraas
simen.kjaras at gmail.com
Sun Dec 12 08:03:57 PST 2010
Eyyub <eyyub34 at hotmail.fr> wrote:
> I recently upgraded to the D 2, and i would like understand for which
> reason they are the immutable keyword !
immutable means 'this data cannot change'. It is different from const in
that the latter means 'I cannot change this data (but someone else may
change it from under my feet)'.
It is added for simplification of sharing (no locking required), and to
a certain extent to allow for better optimization and functional
programming.
--
Simen
More information about the Digitalmars-d-learn
mailing list