Closed AjaniBilby closed 3 years ago
Tie function implementation to a type name
class Person { id: int; age: int; fn Age(p: @Person) { p.age = p.age + 1; return; } fn Say(p: Person) { print("Person { id: "); print(id); print(", age: ") print(age); println(" }"); return; } } int main () { let p = Blank#[Person](); Person.Say(p); Person.Age(@p); Person.Say(p); }
Tie function implementation to a type name
Example