Context of Def/Use Sites
We have seen some contextual definitions and uses of names.
In Java:
int i, j, k
where the issue is to see the type of a variable declaration in each declaration.
In WebDSL: nameless constructors inside native classes.A simple solution for the Java example is desugaring. If we do not want this, we can have a list matching pattern:
VarDecs(t, [..., VarDec(n), ...]): defines Var n of type t in subsequent scope
Problem here is, that is not clear which subsequent scope to use. The one of
VarDec(n)
is intended in Java. To lift it into the subsequent scope ofVarDecs(...)
you would need to import it, like we do for grouped let declarations. But this might not be clear to NaBL users. Another approach is to use aninside
clause on the match:VarDec(n) inside VarDecs(t, _): defines Var n of type t in subsequent scope
Here it is more clear that it is the subsequent scope of VarDec which we are talking about. However, it is not clear if this applies for any
Submitted by Guido Wachsmuth on 8 March 2013 at 18:32VarDec
insideVarDecs
or only at the first level or only in the second argument.
Issue Log
The current work around is to desugar this into a list of single declarations.
Log in to post comments