Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function syntax #23

Closed
aleclarson opened this issue Nov 1, 2018 · 1 comment
Closed

Function syntax #23

aleclarson opened this issue Nov 1, 2018 · 1 comment

Comments

@aleclarson
Copy link

Why was the explicit fn added? Why not..

# Function literals
let foo = (a, b): void {
  doSomething(a, b) # this return value is ignored because `: void`
}
let bar = async iter (a, b) {
  yield await doSomething(a, b)
}

# Function types
type Foo = (a, b): void
@jamiebuilds
Copy link
Owner

jamiebuilds commented Nov 1, 2018

Because consistency:

let v = fn (...) {...}
let v = if (...) {...}
let v = for (...) {...}
let v = match (...) {...}
let v = while (...) {...}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants