As some of you have realized, each box has it’s own set of names (it’s own namespace). A
var x=10 in one box doesn’t appear in any other, nor does it conflict with any other boxes existing
x. This is almost always what you want — you know that what you write in one box isn’t going to break another. But what if you want to pass a variable from one box to another?
_. This special variable refers to the box that the code is in.
_.marc = 10 sets a property called
marc inside this box. Crucially, boxes that are connected downstream from this box can also see the value of
_.marc. This lets you build groups of boxes that work together but still don’t necessarily leak there names all over the place.
Secondly, there are times when you do want to set something completely globally. Use
__ to set it (that’s two underscores). That refers to the whole document. So a
__.marc = 10 is visible as
This will be useful for connecting boxes that draw with boxes that make sound
You can see more documentation about