Skip to content

Function Scope

IsaacShelton edited this page Mar 21, 2022 · 1 revision

Function Scope

The function scope is a scope that exists for the duration of a function call

A common example of a function scope having an impact on the program, is in the destruction of values that have a __defer__ method, such as String.

import basics

func main {
    name String = "Isaac Shelton".clone()
    
    // 'name' is implicitly destroyed at the end of the scope
}
Clone this wiki locally