Closed kyleect closed 9 months ago
fn sum(a, b) = a + b; fn divide(a, b) = a / b; fn both(a, b) = identity(divide(sum(a, b), b)); fn identity(value) = value; print sum(10, 10); // out: 20 print sum(10, -3); // out: 7 print both(10, 5); // out: 3
class Box { let value; fn init(value) { this.value = value; } fn get() = this.value; } let box = Box("Hello"); print box.get(); // out: Hello box.value = "World"; print box.get(); // out: World
Functions
Methods