I assume this is not a bug, but merely a gap in my understanding, however I would love someone to eplain this detail, which to me seems inexplicable.
This is the contects of WidgetSet::RadioButton.Outlet
// Check if the new outlet differs from the currently used outlet
if ( pure Outlet == value )
return;
// Detach from the previous outlet
if ( pure Outlet != null )
detachobserver onOutlet, pure Outlet;
// Store the new outlet ...
pure Outlet = value;
// ... and attach to the new one
if ( value != null )
attachobserver onOutlet, value;
// Finally, retrieve the current state of the property associated via 'Outlet'.
if ( value != null )
signal onOutlet;
My question concerns the line in bold, "attachobserver onOutlet, value".
Why have we written this and not "attachobserver onOutlet, pure Outlet"? I understand that "value" is in some sense a pointer to a place is memory, and attachobserver is assigning onOutlet to listen for changes in this value. But that doesn't really explain why we can do this with "value", when I thought "value" would have been defined only in the scope of this method, or why we do this when it looks like EW has syntax for binding to Properties too. https://doc.embedded-wizard.de/attachobserver-statement?v=14.00
It is possible that I am coming at this from too much of a C++ background, but any illumination would be appreciated here.