Skip to content

Instantly share code, notes, and snippets.

@jyrkiput
Created April 7, 2012 16:29
Show Gist options
  • Save jyrkiput/2330148 to your computer and use it in GitHub Desktop.
Save jyrkiput/2330148 to your computer and use it in GitHub Desktop.
value vs. function
def foo(i: Int, value: Int) {
if(i > value)
println("was bigger")
else
println("was smaller")
}
def foo(cmp : Int => Boolean, value: Int) {
if(cmp(value))
println("was bigger")
else
println("was smaller")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment