Last active
March 17, 2023 13:26
-
-
Save s1monw1/86c9abe05032346f245a6ee2b6637fab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PrintingCustomizer { // PrintingCustomizer is a dispatch receiver | |
private val separator = "________________" | |
fun <K, V> Map<K, V>.customPrint() { // Map<T, V> is an extension receiver for customPrint | |
forEach { (k, v) -> | |
println("K: $k") | |
println("V: $v") | |
println(separator) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment