Guest User

Untitled

a guest
Jun 23rd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. fun startHere() {
  2. for (index in 0..100) {
  3. var addResult = calculate(10, index, { x, y ->
  4. x + y
  5. })
  6. ...
  7. }
  8. }
  9. inline fun calculate(x: Int,
  10. y: Int,
  11. equation: (x: Int, y: Int) -> Int): Int {
  12. // Do something
  13. return equation(x, y)
  14. }
Add Comment
Please, Sign In to add comment