Skip to content

Instantly share code, notes, and snippets.

@xerz-one
Last active October 18, 2016 12:14
Show Gist options
  • Save xerz-one/9c820fd5e533e88a2eba87f534388a77 to your computer and use it in GitHub Desktop.
Save xerz-one/9c820fd5e533e88a2eba87f534388a77 to your computer and use it in GitHub Desktop.
fun main(args: Array<String>) {
val nine = fun (): Int { return 9 }
val funMap = mapOf<Any, () -> Any>(
"meme" to fun (){ println("kotlin is dank meme m8") },
"nine" to fun (): Int { return nine() },
9 to fun (): String { return "number nine" }
)
funMap["meme"]?.invoke()
for (i in 1..nine()) {
println(funMap[funMap["nine"]?.
invoke()]?.invoke())
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment