Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
object HelloMain {
def main(args: Array[String]) = {
var sum: Int = 0
(1 to 10).foreach( s => ((x: String) => println(x))(s.toString) )
(1 to 10).foreach( s => ((x: Int) => {
sum += x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.