Skip to content

Instantly share code, notes, and snippets.

@developer-sdk
Created March 8, 2019 12:49
Show Gist options
  • Select an option

  • Save developer-sdk/8e5e2fe373622b028fcf1494d38b6989 to your computer and use it in GitHub Desktop.

Select an option

Save developer-sdk/8e5e2fe373622b028fcf1494d38b6989 to your computer and use it in GitHub Desktop.
스칼라,커링
def modN(n: Int)(x: Int) = ((x % n) == 0)
// modN함수를 커링을 이용하여 n 값이 정해진 변수로 호출
def modOne:Int => Boolean = modN(1)
def modTwo = modN(2) _
println(modOne(4)) // true
println(modTwo(4)) // true
println(modTwo(5)) // false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment