|
|
|
|
|
by erik_seaberg
568 days ago
|
|
Hundreds of programming languages set very high expectations, which should support groundbreaking ideas like Lisp style macros and multimethods, ML style pattern matching, Prolog style search and unification, and Smalltalk style metaprogramming on runtime classes and overriding doesNotUnderstand. I have to admit that right now it's a dynamically typed imperative language that looks a lot like Python. |
|
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