SuperC documentation

Type methods

Under the hood, this is pure syntactic sugar for a function that takes the “receiver” as its first parameter, but the ergonomic and architectural benefits are anything but superficial.

This is not only easier, but safer, because it prevents the programmer from passing a wrong type to the function like player_move(&enemy).

Examples


Previous

Nullish coalescing operator

Next

Operator overload
Playground