Open uliwitness opened 3 years ago
Bonus thought: Could this be made a general mechanism, where not just user properties, but the entire script of the sharedStorage is inherited? Kind of a blueprint/class style deal? Or would that be mixing apples and oranges? Given the script would often also need to access non-shared properties, how would you conveniently declare those if they aren't inherited? Why would they be shared and not copied/inherited?
A lot of shared information was traditionally kept in globals in HyperTalk. In modern languages, there are many smaller scopes that you can use to avoid namespace collisions between different modules. We already have user properties as a storage that is namespaced to that instance. (a property "foo" on cd btn 1 can be completely different than one of the same name on cd btn 2)
It seems like it could be a good first step to add something like that to user properties. To provide some sort of "shared" user property that can be addressed just like any other user property, but whose value is shared by multiple objects.
Can we find a good syntax for that? Or is it enough to just tell scripters to create an invisible object to hold all those properties and access them from another?
Maybe something like
?
One major advantage of this would be the brevity of saying
my shared1
inside "storageAccessor1"'s script instead of having to writeshared1 of cd btn "sharedStorage"
. Of course it could also be surprising if there was a "storageAccessor2" whoseshared1
property would suddenly also change.