4 ms·
There is: http://scala-lang.org/files/archive/spec/2.11/06-expressions.html#return-expressions http://scala-lang.org/files/archive/spec/2.11/06-expressions...
by draven 11y ago
There is:
http://scala-lang.org/files/archive/spec/2.11/06-expressions.html#return-expressions http://scala-lang.org/files/archive/spec/2.11/06-expressions...
The general consensus is: don't use it.
- lisper 11y agoAh, there it is. OK, so I'm still confused. > you can get the same functionality (in a better / more consistent way) using library types RETURN is a control construct. How do you emulate a control construct using types?
- lmm 11y agoIn a language with first-class functions, control constructs can be replaced by polymorphic methods - see smalltalk for the ultimate version of this. In scala the idiomatic way to do "short-circuit the rest of this in some cases" is usually for/yield with a type like scalaz's \/.