P
Philip Lantz
It really requires two different symbols:
'=' to mean dynamic assignment
'==' (perhaps) to mean one-time initialisation
The trouble is the current usage in C uses '=' for both meanings.
C does have different syntax to mean dynamic assignment vs. one-time
initialization. They do both use the '=' symbol, but they are easily
distinguished, both by the compiler and the programmer.
My 2 cents worth:
I definitely do not think that extending initialization of statics to
allow non-constant expressions should also imply that they should be
"initialized" more than once; that would completely ignore the concept
of "initialization".
If you want to assign a value to a static variable, use assignment!
Don't try to use initialization for a role it doesn't have.
Of course, as others have pointed out, Jacob is free to implement
this extension in the way that he thinks is most useful to his
users. This is just my opinion. I would also encourage the generation
of a warning message for this construct, unless the user explicitly
enables the feature.
Philip