Package: tcl8.6
Version: 8.6.11+dfsg-1
Severity: normal
X-Debbugs-Cc: davide.pr...@gmail.com

Dear Maintainer,

I'm try to learning tk and I think I have found a bug.
I'm try to understand nested dict and I have done a very simple script:

--8<----8<----8<----8<----8<----8<---
set Livello0 [dict create Livello 0]

dict set Livello0 MAP {A B C}
dict with Livello0 { lappend MAP D}

puts "Livello0: $Livello0"
puts "MAP [dict get $Livello0 MAP]"

dict with Livello0 { lappend MAP C {1 2}}

puts "Livello0: $Livello0"
puts "MAP [dict get $Livello0 MAP]"

dict with Livello0 MAP { lappend C {3}}

puts "Livello0: $Livello0"
puts "MAP [dict get $Livello0 MAP]"

if [dict exists $Livello0 MAP D] {puts "Exist"} else {puts "Non exist"}
--8<----8<----8<----8<----8<----8<---

if I execute this script with tclsh I get the followin output:
--8<----8<----8<----8<----8<----8<---
Livello0: Livello 0 MAP {A B C D}
MAP A B C D
Livello0: Livello 0 MAP {A B C D C {1 2}}
MAP A B C D C {1 2}
Livello0: Livello 0 MAP {A B C {1 2 3}}
MAP A B C {1 2 3}
Non exist
--8<----8<----8<----8<----8<----8<---

Note that I have done an insert of C {1 2} and it has added
MAP {A B C D C {1 2}}
with C key present two time

when I have added a new item {3} in C
it has deleted the D key and replaced the two C keys with the last one

I have tryed to find an open bug on Tcl site without success.

Ciao
Davide

-- System Information:
Debian Release: bookworm/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'testing-debug'), (500, 'stable-security')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.46-dp-20210807 (SMP w/4 CPU threads; PREEMPT)
Kernel taint flags: TAINT_UNSIGNED_MODULE
Locale: LANG=it_IT.utf8, LC_CTYPE=it_IT.utf8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages tcl8.6 depends on:
ii  libc6      2.31-17
ii  libtcl8.6  8.6.11+dfsg-1

tcl8.6 recommends no packages.

Versions of packages tcl8.6 suggests:
pn  tcl-tclreadline  <none>

-- no debconf information

Reply via email to