Use local order instead of global OperatorCounter #51
Description
I've read the current PROTOSPEC.md and tripped over the behavior of the [[OperatorCounter]]
internal slot. It is initialised when the operator set is created, and informs the dispatch resolution:
if
a
's operator set has a lower[[OperatorCounter]]
thanb
's operator set, …
This seems hazardous. The resolution of overloaded operators would depend on execution order of the modules that did create the operator set, and thereby on import order in modules possibly located far away from the usage of the overloads. This is fragile and will easily break.
Instead, I suggest that the resolution of an operator should depend on the order in which the respective operand's operator sets were introduced into the local scope wit with operators from
declarations.