New Features of Eli Version 4.4
The Oil operator identification functions return an invalid operator if
the specified operator indication is not associated with an operator
matching the context specified.
This results in a possibly misleading error report, effectively stating
that there is no such operator.
When an operator indication is associated with exactly one operator, it may
be preferable to indicate specific mismatches between the requirements of
the operator and the types produced by the context.
This can be done by returning the only possible operator, which places
appropriate constraints on the types of the operands and delivers a
specific result type.
OilNoOverload takes two arguments.
The first is the operator indication being identified and the second is the
result of a normal Oil operator identification function.
The value of the second argument is returned if it is valid.
If the second argument is invalid, OilNoOverload checks whether the
first argument is associated with exactly one operator.
If so, then OilNoOverload returns that operator; otherwise it
returns the invalid operator yielded by the second argument.
OilNoOverload( `oi', OilIdOpTS2( `rt', `oi', `ats1', `ats2' ));
The arguments are:
- `oi'
- The operator indication being identified.
- `rt'
- The required result type.
- `ats1'
- The set of possible first operand types.
- `ats2'
- The set of possible second operand types.
|