Re: SWITCH question

new topic     » goto parent     » topic index » view thread      » older message » newer message
irv said...

Yes, I can confirm that all 3 run properly when compiled.

Hate to say it, but I would wager that is the result of constant propagation, ultimately in effect a red herring of little to no help at all here.

During interpretation, after a=1 b=a, the interpreter still thinks b is variable, obviously it may yet be assigned to something else later on, but when compiling, after some (repeated) whole-program analysis, it ends up knowing that b can only be 1, and then gets to treat it as a constant [and in fact that is exactly what a constant (literal integer) is: a variable with min==max]. It doesn't do that extra analysis when interpreting, for obvious performance reasons.

Pete

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu