如何更改 Io 语言列表中元素的值?

how to change the value of an element in a list in Io language?

我想知道如何更改 Io 语言列表中元素的值?

l := list(4, 6, 3, 8, 10)
list(4, 6, 3, 8, 10)

我想改成:

list(4, 5, 3, 8, 10)

一种方法是使用insertAt()removeAt(),但我想知道是否还有其他方法。

l removeAt(1)
l insertAt(5, 1)

有什么想法吗?

你可以这样做:

l atPut(1, 5)

这会将索引 1 替换为值 5。