Created
April 7, 2012 16:29
-
-
Save jyrkiput/2330148 to your computer and use it in GitHub Desktop.
value vs. function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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