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
Identifier also in the SchemeExp hierarchy, and in all hierarchies it is required. This causes Identifier to be part of multiple hierarchies, but keeps things simple.
- Use
SchemeVar in 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.
Currently, for the analysis of Scheme, the expression type
SchemeExpis used, which subclasses the general type of expressions,Expression. One of the classes of Scheme expressions isSchemeVar, which in essence wraps aroundIdentifier, that in turn subclassesExpressionbut notSchemeExp.It is expected for
SchemeVarto be used whenever variables appear in a Scheme expression, such as in lambdas and let constructs. However, often,Identifiers are used directly (e.g., theargsvariable inSchemeLambdaExpis a list of identifiers. This causes issues, asIdentifieris not part of theSchemeExphierarchy. 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:
Identifieralso in theSchemeExphierarchy, and in all hierarchies it is required. This causesIdentifierto be part of multiple hierarchies, but keeps things simple.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.