On 06-03-2012 16:44, Stewart Gordon wrote:
On 06/03/2012 15:19, Alex Rønne Petersen wrote:
<snip>
Shouldn't invariant as a type modifier be deprecated once and for all?
I mean, immutable
has existed for a long time now...

It already is deprecated. Download a current DMD version and see for
yourself.

But how does this help? The ambiguity isn't gone until this use of
invariant is removed from the language/compiler completely.

To clarify: I meant remove the feature entirely.


Also, just so we're on the same page here, you mean the parentheses,
right? If so, I'm not
sure I quite understand where the problem arises. Could you elaborate?

invariant {
int id;
char[] name;
}

Is this a block of class-level invariant member declarations, or a class
invariant that does nothing but declare two local variables?

Since D2's early days it has dealt with it by using invariant() for the
latter.

Stewart.

I totally didn't think of that. Thanks!

I wonder if we have any plans for when invariant as a type modifier will be removed entirely...

--
- Alex

Reply via email to