Skip to content

Instantly share code, notes, and snippets.

@shahsurajk
Last active November 27, 2019 19:02
Show Gist options
  • Save shahsurajk/168b1d735b55af8d09332a8ea70cf606 to your computer and use it in GitHub Desktop.
Save shahsurajk/168b1d735b55af8d09332a8ea70cf606 to your computer and use it in GitHub Desktop.
Non inlined lambda
fun testLambdas(index: Int, myLambda: (index: Int) -> Unit){
myLambda.invoke(index+1)
}
fun myBigLoop(){
(0 .. 50).forEach {
// our lambda being consumed here.
testLambdas(it) { lambdaValue->
println(lambdaValue)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment