Hi there, first time poster...how would I call a f...
# getting-started
w
Hi there, first time poster...how would I call a function (indexInc) if that function is a value in a map? Thank you
Copy code
val indexInc = {if (index++ == memory.size - 1) memory.add(0u)}
val commands = mapOf(">" to indexInc, "<" to indexDec)
❤️ 1
i
Copy code
commands[">"]?.invoke()
👍 3