Skip to content

Instantly share code, notes, and snippets.

@ussy
Created August 13, 2010 15:58
Show Gist options
  • Save ussy/523110 to your computer and use it in GitHub Desktop.
Save ussy/523110 to your computer and use it in GitHub Desktop.
def calc(n: Int)(block: Int => Int) = {
block(n)
}
println(calc(10) { n =>
if (n % 2 == 0) return 0
n * 2
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment