Skip to content

Instantly share code, notes, and snippets.

@landon9720
Created July 12, 2011 15:42
Show Gist options
  • Save landon9720/1078234 to your computer and use it in GitHub Desktop.
Save landon9720/1078234 to your computer and use it in GitHub Desktop.
scala> def sum(x: Int, y: Int) = x + y
sum: (x: Int, y: Int)Int
scala> def plus1 = sum(_: Int, 1)
plus1: (Int) => Int
scala> plus1(2)
res0: Int = 3
scala> def plus2 = sum(2, _: Int)
plus2: (Int) => Int
scala> plus2(2)
res1: Int = 4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment