How to get a reference on the Itcl class member variable?
问题 Say I have the following structure: package require Itcl itcl::class AAA { private variable m_list {} constructor {} { fill m_list list } } How to get a reference on the m_list in order to write foreach elem $reference {.......} Consider that list is really big and I don't want to copy it! 回答1: Tcl variables use copy-on-write semantics. You can safely pass a value around, assigning multiple variables to it, without worrying about it taking up more space in memory. For example set x {some list