New Features of Eli Version 4.3
The OilList module provides computations that implement parameter lists and argument lists for operator identification of function calls. The elements are arranged in left-to-right order as they occur in the tree.
OilList is instantiated simply by mentioning its name:
It provides the computational roles ParameterListRoot, ParameterListElem, ArgumentListRoot, and ArgumentListElem to support type analysis, the the roles ArgumentDeListRoot and ArgumentDeListElem to support code generation.
The CLASS SYMBOL ParameterListElem is to be inherited by those SYMBOLs that contribute parameter types to the parameter list. The value of the attribute ParameterListElem.GivenType (of type tOilType) must be set by the user.
The CLASS SYMBOL ParameterListRoot is to be inherited by a SYMBOL that has all of the parameter SYMBOLs in its subtrees. The result of the computation is the attribute ParameterListRoot.ParameterList of type tOilArgSig, which specifies all of the parameter types. In order to obtain a complete signature for the function, the result type (ResType, for example) must be added: OilAddArgSig(ResType, ParameterListRoot.ParameterList)
The CLASS SYMBOL ArgumentListElem is to be inherited by those SYMBOLs that contribute arguments to the argument list. The value of the attribute ArgumentListElem.GivenType (of type tOilType) must be set by the user.
The CLASS SYMBOL ArgumentListRoot is to be inherited by a SYMBOL that has all of the argument SYMBOLs in its subtrees. The result of the computation is the attribute ArgumentListRoot.ArgumentList of type tOilSetSig, which specifies all of the argument types. It can be used in a call to OilIdOpTSn to identify a function whose parameter types could be the result of coercing the argument types.
The CLASS SYMBOL ArgumentDeListElem is to be inherited by those SYMBOLs that contribute arguments to the argument list. The result of the computation is the attribute ArgumentDeListElem.RequiredType of type tOilType, which specifies the type required by the function for that argument.
The CLASS SYMBOL ArgumentDeListRoot is to be inherited by a SYMBOL that has all of the argument SYMBOLs in its subtrees. The value of the attribute ArgumentDeListRoot.Operator (of type tOilOp) must be set by the user.
Please note that it is not sensible to try to test the value of ArgumentDeListElem.RequiredType against the a priori type of the argument expression for the purpose of error reporting. The reason is that if ArgumentDeListRoot.Operator is a valid operator then there is no error, and if ArgumentDeListRoot.Operator is an invalid operator then there is no information about the required types of the arguments.