Chapter 9. Scopes and Namespaces

Scopes and namespaces are use to avoid entities like symbols and functions in different parts of the program to collide with each other. This section will cover how they works.

9.1. Scopes

Scopes are containers of symbols (variables, constants and labels). There can only be one symbol of each name in a scope. Scopes are automatically in many situations. For example, a scope is set up when you execute a macro. This prevent the internal labels to collide if you execute the macro twice.

The easiest way to define a scope yourself is using brackets.

.var x = 1
{
   .var x = 2  // <- this x won't collide with the previous
}