Skip to content

Latest commit

 

History

History
27 lines (17 loc) · 534 Bytes

scope.md

File metadata and controls

27 lines (17 loc) · 534 Bytes

Home

Scope

Each function receives a unique scope.

Global scope

Declarations outside of any function exist in the global scope.

Structs

All structs, regardless of where they are created, exist in the global scope.

Example

# The int "globalInt" exists in the global scope
int globalInt = 100;

function printSum : int as left, int as right;
    # The int "sum" exists within the scope of function "printSum"
    int sum = left + right;
  
    println sum;
return;