thp-lang.org/md/learn/classes/magic.md
2023-10-25 20:51:20 -05:00

263 B

Magic methods

Don't get special treatment.


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

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

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