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 of VarDecs(...) 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 an inside 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 VarDec inside VarDecs or only at the first level or only in the second argument.

Submitted by Guido Wachsmuth on 8 March 2013 at 18:32

On 8 March 2013 at 18:33 Guido Wachsmuth tagged rfc

On 29 April 2013 at 18:53 Guido Wachsmuth commented:

The current work around is to desugar this into a list of single declarations.


On 7 May 2013 at 23:01 Guido Wachsmuth closed this issue.

Log in to post comments