(no title)
-J | 1 year ago
func doesNotUnderstand(method, args) {
"Person " + this.name + " does not have " + method
}
}func greet(person: Person) { match person { {name: "Alice", age: 30} => "Hi Alice, you're 30." {name, age} if age > 18 => "Hi " + name + ", you're an adult." _ => "Hello there!" } }
macro log_call(func) { `(println("Calling " + ${func})) }
let alice = new Person("Alice", 30) log_call(greet(alice)) # Expands to println and calls greet
No comments yet.