Name call arguments

name: expression binds an argument to that parameter. Positional arguments come first; named arguments may then appear in any order and can skip a default.

Expressions still evaluate from left to right as written. Named calls apply only when moon knows the declaration, so function values and built-in calls take exact positional arguments.

fn endpoint(host: string, port: int = 8080, secure: bool = false) -> string {
  "$host:$port:$secure"
}

fn main() {
  println(endpoint("example", secure: true))
  println(endpoint(secure: false, host: "other", port: 9000))
}
Output & diagnostics
Expected:
example:8080:true
other:9000:false
Ctrl/⌘+Enter runs the current lesson.