div0:
Yeah, I *never* access static vars through an instance,
I always use the class name.
Somebody want to post in the main group?
It seems there are few people that agree with you, but Walter has not answered
about this yet, so you can ask him his opinion. I like to use a tidy language.
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
bearophile wrote:
I'm playing some more with immutables in D2. This program compiles:
struct Foo {
static int x;
}
void main() {
immutable Foo f;
Foo.x++;
f.x++;
}
Is this code supposed to be correct? If I have an
bearophile wrote:
I'm playing some more with immutables in D2. This program compiles:
struct Foo {
static int x;
}
void main() {
immutable Foo f;
Foo.x++;
f.x++;
}
Is this code supposed to be correct? If I have an immutable struct I want all
of it to be immutable...
Bye and
div0:
putting it in Foo simply puts it in a namespace.
So my (wrong) idea of immutable applied to a struct was that every thing in
such namespace becomes immutable (I think this is a bit more intuitive).
What do you think of modifying D2 so in a situation like the one I've shown
even static
On 03/05/2010 07:50 PM, bearophile wrote:
div0:
putting it in Foo simply puts it in a namespace.
So my (wrong) idea of immutable applied to a struct was that every thing in
such namespace becomes immutable (I think this is a bit more intuitive).
What do you think of modifying D2 so in a
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Pelle Månsson wrote:
On 03/05/2010 07:50 PM, bearophile wrote:
div0:
putting it in Foo simply puts it in a namespace.
So my (wrong) idea of immutable applied to a struct was that every
thing in such namespace becomes immutable (I think this is a
div0:
Somebody want to post in the main group?
OK, I'll do it soon :-)
Bye,
bearophile