digitalmars.D.learn - immutable storage class?
- Sergey Kovrov (2/2) Mar 06 2009 I cannot find any information about immutable keyword. I presume it is a...
- bearophile (4/5) Mar 06 2009 I think it's the new (correct) name for invariant.
- Sergey Kovrov (2/2) Mar 06 2009 From playing with compiler looks like immutable and invariant are practi...
- Robert Fraser (6/9) Mar 12 2009 From the newsgroup discussions, it's just a change of name, with the
-
Stewart Gordon
(4/5)
Mar 06 2009
- Jesse Phillips (5/12) Mar 06 2009 I'm not sure what is the real reason for it's existence, but it seems
I cannot find any information about immutable keyword. I presume it is a storage class and should be described in "Declarations" manual page, but it is not. On the other hand it is mentioned in changelog and some manual pages. Is it an alias for invariant or const, or something completely different? -- serg.
Mar 06 2009
Sergey Kovrov:Is it an alias for invariant or const, or something completely different?<I think it's the new (correct) name for invariant. Bye, bearophile
Mar 06 2009
From playing with compiler looks like immutable and invariant are practically interchangeable. And typeof reports that invariant is really immutable. I personally like immutable keyword better, but wonder if it is just a change of name or something more? -- serg.
Mar 06 2009
Sergey Kovrov wrote:From playing with compiler looks like immutable and invariant are practically interchangeable. And typeof reports that invariant is really immutable. I personally like immutable keyword better, but wonder if it is just a change of name or something more? -- serg.From the newsgroup discussions, it's just a change of name, with the exception that only invariant can be used for class invariants: class Foo { invariant() { } }
Mar 12 2009
Sergey Kovrov wrote:I cannot find any information about immutable keyword.<snip> http://d.puremagic.com/issues/show_bug.cgi?id=2572 Stewart.
Mar 06 2009
On Fri, 06 Mar 2009 08:58:04 -0500, Sergey Kovrov wrote:I cannot find any information about immutable keyword. I presume it is a storage class and should be described in "Declarations" manual page, but it is not. On the other hand it is mentioned in changelog and some manual pages. Is it an alias for invariant or const, or something completely different? -- serg.I'm not sure what is the real reason for it's existence, but it seems many people prefer the term immutable over invariant. So I guessed that Walter is planning on changing the name to immutable. He might keep both in there, but I really don't think that is a good idea.
Mar 06 2009