Improve accessing and modifying variables of components
Accessing variables via variable references seem to cause confusion and be impractical for certain applications.
- Confusing:
myComp.vs.x
does not return the variable but the reference, so one has to access the variable through the property.value
. The variable itself also has a value, so the word "value" is overloaded here. E.g., to get the value of a variable, one has to writemyComp.vs.x.value.value
. - There are no methods on variable references for subscribing to the value of the variable that a reference points to.
Suggestion: "lift" variable methods up to variable references.
- Subscribing:
myComp.vs.x.subscribeValue(...)
- What happens when the reference
x
becomes dangling?
- What happens when the reference
- Setting variable value:
myComp.vs.x.setValue(...)