Constant Expressions



next up previous contents index
Next: Primaries Up: Expressions Previous: Precedence and Associativity

Constant Expressions

Constant expressions are a limited kind of expression that can be used in equates. They are evaluated at compile time to produce objects of built-in, immutable types. They can contain method calls but only to methods belonging to compile-time known, built-in immutable objects; the only other calls are to certain built-in, side-effect-free routines. The following forms are allowed: Evaluation of a constant expression must terminate normally or there will be a compile-time error.



theta-questions@lcs.mit.edu