goboscript
goboscript copied to clipboard
Add the of expression
This PR adds the of expression, representing the ([property v] of [something v]) sensing reporter. This allows other sprites to read (but not write) private variables of another sprite, along with some other attributes like direction and costume names.
Here's how one would use this:
# foo.gs
var something = "123";
# bar.gs
onflag {
say something of foo; # says 123
}
Things like verifying names and documentation is yet to be implemented.
there was an existing idea for a different syntax that would allow for this and be able to be used in other contexts too, using the @ symbol. however it would not be used for accessing variables. maybe this is an alternative, idk