Christophe said:
xaos wrote:
Please don't toppost
And what should the compiler do once a you have another constructor, that
starts with x != 0?
the condition of 'finality' will not change.
I would make the assignments outside the constructor, possibly
statically. I would make X private with no other references to X except
the X=initialValue, and the X++ assignments - if that were to help
allay the compiler's complaints.
the nature of the sequencing assures undoubtedly that there will never
be two identical cases in a switch.
A switch statement is not a just another way of using if/else if/else, it is
a special construct even at the bytecode level.
Yes indeed, it [switch] was reproduced from the alluring performance of
it's c++ parent, and according to Java In a Nutshell, "not very
java-like" but neccesary.
There is a degree of foreignness apparent in switch code, in that java
doesn't even have a 'constant' keyword but implicitly imposes the
condition as borrowed from C++.
it's odd that java's optimization depends on me doing the work, actually
typing out literals.
Well, not to bend java archetecture to my convenience. I'll write a
pluggin to work the desired initialization.
Anyway, there is either something very fundemental in the compile time
(dynamic look-ups, procedural order, etc. ) and or runtime procedure
that precludes the possibility of making a compile time evaluation of
X++ suitable to switches,
or
java's switch was contrived to fit C++'s form and X++ just won't fit the
mold.
thank's all
hi ho it's off the the salt mine...
~S~