4 ms·
Granted Im not the target market, but Implicit returns do not seem like a good idea.
by srik 15y ago
Granted Im not the target market, but Implicit returns do not seem like a good idea.
- famousactress 15y agoYeah, is there precedent for that? It looks fucking nutty. Can you do it in the middle of the function!? So odd. There's a lot of cruft in java, but I'm not sure the return statement is even on the list of things I'd bother attacking.
- MichaelGG 15y agoFunctions in mathematics sets a good precedent for lack of a return keyword. Where did you see that it says you can do it in the middle of a function? I understood it implicitly returns the last expression.
- aidenn0 15y agoAs far as a precedent, lisp does it that way, and it may be older than the existence of the return statement. Any language that lacks statements usually does it this way.
- rayiner 15y agoLisp, Dylan, Smalltalk, ML, Haskell, CoffeeScript, and Dart all have various levels of implicit return. It makes sense in a language where there are no statements, just expressions. Generally code is written to not need to return from the middle of a function. This is only really inconvenient in loops, and at least Dylan, Lisp, and Smalltalk make some provision for an "early return."
- Roybatty 15y agoSomeone said Dylan so I just respond...my favorite language of all times :)