-
Notifications
You must be signed in to change notification settings - Fork 13
Description
Currently, for the analysis of Scheme, the expression type SchemeExp is used, which subclasses the general type of expressions, Expression. One of the classes of Scheme expressions is SchemeVar, which in essence wraps around Identifier, that in turn subclasses Expression but not SchemeExp.
It is expected for SchemeVar to be used whenever variables appear in a Scheme expression, such as in lambdas and let constructs. However, often, Identifiers are used directly (e.g., the args variable in SchemeLambdaExp is a list of identifiers. This causes issues, as Identifier is not part of the SchemeExp hierarchy. Hence, when e.g., the subexpressions of a Scheme expression are collected, it can not be guaranteed that these expressions are Scheme expressions as well. Clearly, this does not follow the intuitive and logical hierarchy that is to be expected.
Several solutions to this issue are possible:
- Introduce
Identifieralso in theSchemeExphierarchy, and in all hierarchies it is required. This causesIdentifierto be part of multiple hierarchies, but keeps things simple. - Use
SchemeVarin a more consistent manner. The downside is that this class is a wrapper class that provides little additional functionality, so creating more variable objects can entail needless overhead.