thp-lang.org/md/learn/classes/magic.md
2024-02-20 05:17:21 -05:00

25 lines
262 B
Markdown

# Magic methods
Don't get special treatment.
```thp
class Cat
{
pub fun __sleep() -> Array[String]
{
// logic
}
}
```
```thp
val option = Some("GAAA")
val Some(value) = option
val colors = Array("red", "green", "blue")
val Array()
```