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.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 489 |
Nodes: | 16 (2 / 14) |
Uptime: | 45:59:50 |
Calls: | 9,670 |
Calls today: | 1 |
Files: | 13,719 |
Messages: | 6,170,073 |