Community
Participate
Working Groups
When resolving the EGL function for compound assignment operators like "+=" and "::=", the compiler should look for a function for the non-assigning form of the operator. In other words, when resolving the operation function for "x *= 4", look for the "*" function as if the expression were written "x = x * 4". This means EGL types don't have to define functions for the assigning form of the operators they support. This implicit definition saves some keystrokes, but more importantly it eliminates the possibility of mistakes. There's no way to omit a compound assignment operator or accidentally use a different operand type from the non-assigning operator. The Assignment class should have a getOperation() method which will retrieve the Operation of a compound assignment.
API for getOperation()/setOperation() has been added to Assignment.java (and AssignmentImpl.java), as well as Expressions.egl. If the assignment does not use a compound operator, getOperation() returns null.
Closing.