Hi,
The current behavior, which indeed is preserved in the Playground because we did not get to revisit it yet, is like that:
- if you do not define a variable explicitly, it will appear red.
- if you run the code, the variable will be automatically define within the scope of the Playground/Workspace object which lives as long as the window does
- thus, essentially you get a kind of a persistent variable that survives an execution
- that is the reason why you can inspect the variable and get the result that it has accumulated
- one source of confusion is that after you run the code, the variable still remains red. However, after you type one character, it gets blue.
Ideally, we should have a more interactive way of defining variables and have an overview available at all times.
Cheers,
Doru