Created
September 17, 2012 12:28
-
-
Save stephenLee/3737017 to your computer and use it in GitHub Desktop.
Scala partially applied function demo
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 sum(a: Int, b: Int, c: Int): Int = a + b + c | |
val a = sum _ | |
a(1,2,3) | |
val b = sum(1, _: Int, 3) | |
b(2) | |
b(5) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment