goboscript icon indicating copy to clipboard operation
goboscript copied to clipboard

Add the of expression

Open Gilbert189 opened this issue 1 year ago • 1 comments

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.

Gilbert189 avatar Apr 05 '25 17:04 Gilbert189

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

faretek1 avatar Apr 06 '25 12:04 faretek1