thp-lang.org/md/learn/classes/magic.md

263 B

Magic methods

Don't get special treatment.


class Cat
{
    pub fun __sleep() -> Array[String]
    {
        // logic
    }
}

let option = Some("GAAA")
let Some(value) = option

let colors = Array("red", "green", "blue")
let Array()