Is your feature request related to a problem? Please describe.extern vars are implicitly declared as singletons to prevent the hosting activity to be called concurrently which could otherwise result in write-write conflicts on that variable.
It might be interesting to declare extern vars explicitly too, in order to assign them to an additional custom singleton domain as it is possible with other implicit or explicit singletons like extern function, function or activity.
Describe the solution you'd like
This is an example of how external variables would be explicitly assigned to a custom singleton in order to prevent dimmDown() to be called concurrently with the SettingsController activity:
singleton LCD
extern singleton [LCD] function dimmDown ()
activity SettingsController ()
extern singleton [LCD] var brightness: nat8
...
end
Describe alternatives you've considered
Alternatively, the hosting activity of the external var (SettingsController in the above example) could be assigned explicitly to the additional singleton domain (LCD). This is possible today and has the same effect but might not be as self documentary as the proposed solution. Also, there is no reason why extern var should be handled differently than other implicit or explicit singleton sources.
Is your feature request related to a problem? Please describe.
extern var
s are implicitly declared assingleton
s to prevent the hostingactivity
to be called concurrently which could otherwise result in write-write conflicts on that variable. It might be interesting to declareextern var
s explicitly too, in order to assign them to an additional custom singleton domain as it is possible with other implicit or explicit singletons likeextern function
,function
oractivity
.Describe the solution you'd like This is an example of how external variables would be explicitly assigned to a custom singleton in order to prevent
dimmDown()
to be called concurrently with theSettingsController
activity:Describe alternatives you've considered Alternatively, the hosting activity of the external var (
SettingsController
in the above example) could be assigned explicitly to the additional singleton domain (LCD
). This is possible today and has the same effect but might not be as self documentary as the proposed solution. Also, there is no reason whyextern var
should be handled differently than other implicit or explicit singleton sources.