我正在使用tcl/java,我试图在其中创建一些TCLDict对象,并使用TCLInterpreter中的setVar在tcl脚本中将该字典对象设置为字典变量。有人能指导我如何在JAVA中使用setVar创建和设置TCLDictionary吗?
提前谢谢。
发布于 2015-01-13 04:10:03
您可以尝试使用setVar创建序列化字典的文本字符串。这是一个简单的字典tcl。我想,如果你对字典进行setVar,你可以在tcl中使用getter方法。
testdict.tcl
#!/usr/bin/tclsh
dict set addresses home "Maple Street"
dict set addresses office "Downtown"
puts $addresses
puts [dict get $addresses office]输出:
./testdict.tcl
home {Maple Street} office Downtown
Downtown所以在这种情况下,我想象一个setVar("addresses","home {Maple Street} office Downtown")或者其他的语法应该会在tcl中为你提供一个字典。
https://stackoverflow.com/questions/27901546
复制相似问题