Skip to content

Instantly share code, notes, and snippets.

@egeysn
Last active July 18, 2020 18:11
Show Gist options
  • Save egeysn/d756842b8892651242f67d22b62e3d4f to your computer and use it in GitHub Desktop.
Save egeysn/d756842b8892651242f67d22b62e3d4f to your computer and use it in GitHub Desktop.
fun sum(a : Int, b : Int) : Int {
return a + b
}
fun higherOrderSumFunction( name : String,
numberOne : Int,
numberTwo : Int,
result : (Int, Int) -> Int) {
println("$name ---> $numberOne + $numberTwo = ${result(numberOne,numberTwo)}")
}
fun main(){
// sum fonksiyonunun başına :: koyarak bir diğer fonksiyonumuza gönderdik
higherOrderSumFunction("Sum",5,9, ::sum)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment