Static in classes

Class constants

class Cat
{
    // Stateful code
}

static Cat
{
    const CONSTANT = "constant value"
}

print(Cat::CONSTANT)thp
    
Syntax error: Unexpected token `Cat`, expected a new line at line 1:6

Static methods

aka. plain, old functions

static Cat
{
    fun static_method() -> Int
    {
        // ...
    }
}

Cat::static_method()thp
    
Syntax error: Unexpected token `Cat`, expected a new line at line 1:7

Static properties

aka. global variables

static Cat
{
    pub var access_count = 0
}

print(Cat::access_count)    // 0
Cat::access_count += 1
print(Cat::access_count)    // 1thp
    
Syntax error: Unexpected token `Cat`, expected a new line at line 1:7