fun foo(msg: String, bar: (input: String) -> Unit) { bar(msg) } // my function to pass into the other fun buz(input: String) { println("another message: $input") } // someone passing buz into foo fun something() { foo("hi", ::buz) }
fun foo(msg: String, bar: (input: String) -> Unit) { bar(msg) } // my function to pass into the other fun buz(input: String) { println("another message: $input") } // someone passing buz into foo fun something() { foo("hi", ::buz) }