Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
226 views
in Technique[技术] by (71.8m points)

Object without ownership could not be modified

在DolphinDB database中执行以下代码:

infos = []
info = dict(INT,INT)
info[1] = 1
infos.append!(info)
infos.append!(info)

def modify(mutable d){
 d[0] = 4
}

modify(infos[0])

报错:

modify(infos[0]) => modify: d[0] = 4 => Object without ownership could not be modified.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

tuple中的元素不能修改。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...