Am 26.04.2022 um 16:15 schrieb Oleg Nemanov:
Hi, all.
I can't understand why in interactive tclsh a var has more refcount, then
in a script:
~$ cat t.tcl
set a [list 1 2]
puts [::tcl::unsupported::representation $a]
~$ tclsh t.tcl
value is a list with a refcount of 2, object pointer at 0x55e14c5c0f90, internal representation 0x55e14c5ce140:(nil), no string representation
~$ tclsh
% set a [list 1 2]
1 2
% puts [::tcl::unsupported::representation $a]
value is a list with a refcount of 3, object pointer at 0x55c8e66ab140, internal representation 0x55c8e66c2ae0:(nil), string representation "1 2"
%
Dear Oleg,
that is due to the history package.
Each interactive result value is stored in the history.
This increases the ref count.
Hope this helps,
Harald
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)