Continuation-Passing Style

Report a typo

Implement the body of a function.

The function is to compute the square of the given integer. Then it should pass the square and the given context to the provided continuation function.

Write a program in Kotlin
fun square(value: Int, context: Any, continuation: (Int, Any) -> Unit) {
// TODO: provide implementation here
}
___

Create a free account to access the full topic