Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想要一个数组作为私有类成员。我使用 Itcl 包。
对于我正在编写的列表和其他简单变量:
itcl::class MyClass { private variable m_myVar "" private variable m_myListVar {} ..........
现在我可以为数组成员做什么?
我认为您应该将变量声明为正常使用 private variable m_myArray,然后在构造函数中将其初始化为数组array set m_myArray {}
private variable m_myArray
array set m_myArray {}