They are optimized. It's just that if there is an error while optimizing, the original expression is kept.
Try compiling something that takes a long time to calculate, but is constant.
/ Per Hedbor ()
Previous text:
2004-01-16 16:25: Subject: Constant expression evaluation
Hi,
What about optimizations of constant expressions in Pike?
Say, something like "x = 1 + 2 * 3" will be evaluated during compile time or runtime? I tested a simple case "x = 1/0" and got runtime error, which makes me doubt that constant expressions will be reduced at compile time...
Regards, /Al
/ Brevbäraren