Those rules are fine.
On 18 Apr 2012, at 16:08, Sébastien Villemot wrote:
I think there is some confusion here. You are mixing the symbol (which is a string of characters) with its assigned value (in some evaluation environment). A symbol by itself is neither a programming variable nor a model variable. This is something that will change from Dynare 4 where currently a symbol is always of a given type; I think we should drop that rule.
Then you have evaluation environments that maps symbols to their values: these environments are only meaningful in a programming context; they are not relevant within a model context (except during the declaration of the model, where you could use programming features, possibly forcing evaluation with the associated operator).
So, this means it is OK to have symbols that take on different values in different scopes. Ie in:
co <- "abc" countries <- {US JA FR}
for (co in countries) { ... }
would be valid code and co would take the values of countries within the scope of the for loop and "abc" both before and after the loop.
Best, Houtan