Map with function
Hi,
I tried a list with function (ki-shell 1.7.0) :
[48] val square = fun(x:Int) : Int {return x*x}
[49] val cube = fun(x:Int) : Int {return x*x*x}
[50] val l_power=mutableListOf(square, cube)
[51] l_power[0](5)
res27: Int = 25
Now with a map
[52] val m_power=mutableMapOf("power2" to square, "power3" to cube)
type results for list or map seems equal
[53] m_power["power2"]
res29: Function1 = (
kotlin.Int) ->
kotlin.Int
[54] l_power[0]
res30: Function1 = (
kotlin.Int) ->
kotlin.Int
Now if I...