Classes

A basic example for a class looks like this:

Greeter.metro
from "fmt" import printlnf
export class Greeter(name String) {
/**
* Print a greeting to the given name.
*/
export greet() {
printlnf(format(), name)
}
hide format() String {
return "Hello, %s!"
}
}

You can use the class above like this:

greeter := Greeter("World")
greeter.greet() // Prints "Hello, World!"