共享字典在函数内部不能用=赋值,可以改成如下代码
def f(){ syncDict(STRING,ANY, `testdict) testdict.dictUpdate!(append!, `Codes, `000001, x->array(x.type(), 0, 512).append!(x)) testdict.dictUpdate!(append!, `Codes, `000002, x->array(x.type(), 0, 512).append!(x)) testdict.dictUpdate!(append!, `Codes, `000003, x->array(x.type(), 0, 512).append!(x)) testdict.dictUpdate!(append!, `00003,1222, x->array(x.type(), 0, 512).append!(x)) ab=testdict[`Codes] ab=ab[ab!=`000001] testdict.erase!(`00003) testdict.erase!(`Codes) testdict.dictUpdate!(append!, take(`Codes,size(ab)), ab, x->array(x.type(), 0, 512).append!(x)) } f()