> For the complete documentation index, see [llms.txt](https://glados.guillaume-hein.fr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://glados.guillaume-hein.fr/features/scopes.md).

# Scopes

In GoMelan some control structures imply different scopes.

### Example for if

```rust
fn main() -> Bool
{
    var: Bool = true;

    if (var) {
        inScope: String = "I'm in this scope only"; // inScope will only lie in this condition
        var = false; // var from outter scope will be modified
    }
    
    // inScope cannot be accessed here

    return var; // Returns false
}
```

{% hint style="info" %}
The control structure **for** is also subject to this scope system.
{% endhint %}
