Compound assignment ops on property accessors
Any chance of seeing compound assignment operators working with property accessors?
Maybe where "object.property += value;" is transformed by the engine into a get, the operation and a set: "object.property = object.property + value;"
The reason I ask is because I'm in a position where I'm forced to use property accessors with some of my main classes. They have definitely helped me solve some important issues with my engine's script interface but I still think having to "unwrap" x += y to x = x + y is a bit unwieldy, especially with more complex expressions.
Not to mention having to explain the difference between members and properties to the users of my software.
I'll do what I can to improve the support for compound assignment with property accessors, however the problem is that having the compiler automatically 'unwrap' the complex expressions may have negative impact on the result of the script which may cause difficult to find bugs, not to mention unexpected performance hits.
Where the property accessor is on a reference type it should be possible to have the compiler keep a reference to the object so that the get/set accessors can be called on the same object without having to re-evaluate the whole expression. On non-reference types this may not be possible, and I may still have to prohibit this.
Where the property accessor is on a reference type it should be possible to have the compiler keep a reference to the object so that the get/set accessors can be called on the same object without having to re-evaluate the whole expression. On non-reference types this may not be possible, and I may still have to prohibit this.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement