[bitc-dev] Static initializer expressions
Swaroop Sridhar
swaroop at cs.jhu.edu
Thu Mar 27 15:45:38 EDT 2008
Jonathan S. Shapiro wrote:
> SHORT TERM
>
> The following are valid initializer expressions:
>
> 1. Literals
> 2. Application of +, -, *, /, OR, AND, IF, where the constituent
> expressions are initializer expressions.
> 3. SIZEOF
> 4. Constructing forms
> 5. Lambda forms. Note that these cannot be applied at initialization
> time because of the limitations of rule [2].
> 6. Statically initialized symbols whose DEFINITION (not declaration)
> are lexically in scope (we say that such a symbol is "observably
> defined at initialization time")
> Does anybody see a problem with the short-term approach above that I may
> be failing to consider?
The application of + - * / etc should be permitted only for applications
on primitive integer types right? Otherwise, the programmer can provide
an instance for the Arith class where these methods are satisfied
through side-effecting functions. Such an application should not be
permitted even though the arguments are initializer expressions.
Swaroop.
More information about the bitc-dev
mailing list