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

Use function statements instead of function expressions. #4

Open
creationix opened this issue Dec 18, 2013 · 1 comment
Open

Use function statements instead of function expressions. #4

creationix opened this issue Dec 18, 2013 · 1 comment
Assignees

Comments

@creationix
Copy link
Owner

No description provided.

@ghost ghost assigned creationix Dec 18, 2013
@creationix
Copy link
Owner Author

This will need a modification to the syntax.

Before, you created a function with:

vars add
add = { a, b | a + b }

After you do it with this maybe?

def add(a, b) { a + b }

This statement is not an expression. It's defined for the entire body of the scope as if it's hoisted to the first line.

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

No branches or pull requests

1 participant