-
Notifications
You must be signed in to change notification settings - Fork 2k
Syntax for functions without implicit returns? #1812
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
Comments
I don't think this suggestion addresses anything that was not covered in #899. If you have anything you feel adds to that discussion, post it there. Closing. |
@reissbaker FWIW, I heartily favor this syntax; but Jeremy prefers the explicit |
Yikes, my bad -- I searched for "implicit returns," but I should've just checked returns in general. |
And FWIW, I agree with Jeremy. But I also feel that loops shouldn't be comprehensions unless we explicitly state we want it to be a comprehension, such as enclosing it in |
Heh. FWIW, I agree that loops shouldn't be implicit comprehensions, too. Oh well. |
This may be a stretch, but it'd be pretty nice in some cases to have function syntax that would make it easier to not return anything. In several libraries (Vows is one that immediately comes to mind, but implicit returns can trip up jQuery code, too), returning from a function means something different than not returning from a function, and having to write the empty return statements everywhere is awkward and can lead to bugs that aren't immediately obvious.
Something like this would make me really happy:
What I like about the
-/>
syntax is that it could work both for the current unbound syntax and for the bound version, and it does exactly what it looks like -- it cuts off and suppresses the returned value.The text was updated successfully, but these errors were encountered: