Functions
Stof functions.
Coffee: {
const bool decaf: false // never!!
bool light_roast: false
Customer: {
name: "Stanly Yelnatz III"
time: Time.now()
}
Shop: {
str name: "Coffee Pot"
str address: "42 Wallaby Way, Sydney"
fn order() -> str {
const order = `${self.name} on ${self.address}\n`;
order.push(`1 ${super.light_roast ? 'light' : 'dark'} roast Coffee`);
order
}
}
fn customer_name() -> str {
self.Customer.name
}
}
#[main]
fn main() -> void {
pln(self.Coffee.customer_name());
pln(self.Coffee.Shop.order());
}Async
Flexible Async
Attributes
Arrow Functions
As a Field
Return
Static Functions
Last updated