We have an open issue concerning initializer expressions. At the moment,
we permit arbitrary expressions. This can lead to forward reference
issues and also to non-terminating initializers.
In the long term, I want a more general solution than the one below, but
I would like BitC to be useful now, and I think that the temporary
solution below will work adequately for now.
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")
Eventually, we would like to allow the application of a broader range of
procedures, and we will probably add a wider range of operators to rule
2 in order to support bit operations.
LONG TERM
Ultimately I would like to include invocation of any observably defined
procedure or lambda form that (1) includes only observably defined
symbols in its closure, and (2) does not (transitively) mutate the
global scope. However, this requires a form of whole-program region
analysis that our compiler does not currently support.
Does anybody see a problem with the short-term approach above that I may
be failing to consider?
shap
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev