tj / luna

luna programming language - a small, elegant VM implemented in C
2.45k stars 147 forks source link

rust style return type notation #32

Closed tj closed 11 years ago

tj commented 11 years ago

currently:

def greet(str:string): string {
  return "hello " + str
}

could be:

def greet(str:string) string {
  return "hello " + str
}

or like rust:

def greet(str:string) -> string {
  return "hello " + str
}

the first two are easier to type, however the extra whitespace introduced by -> makes things a little easier to read IMO

tj commented 11 years ago

without braces it's fine