Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.bugs.dist > #1069189

Bug#993388: tcl8.6: nested dicts: with lappend you can duplicate and than remove intermediate values

From Davide Prina <Davide.Prina@gmail.com>
Newsgroups linux.debian.bugs.dist
Subject Bug#993388: tcl8.6: nested dicts: with lappend you can duplicate and than remove intermediate values
Date 2021-08-31 18:40 +0200
Message-ID <CSeXM-65d-23@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Package: tcl8.6
Version: 8.6.11+dfsg-1
Severity: normal
X-Debbugs-Cc: Davide.Prina@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

Back to linux.debian.bugs.dist | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Bug#993388: tcl8.6: nested dicts: with lappend you can duplicate and than remove intermediate values Davide Prina <Davide.Prina@gmail.com> - 2021-08-31 18:40 +0200
  Bug#993388: [Pkg-tcltk-devel] Bug#993388: tcl8.6: nested dicts: with lappend you can duplicate and than remove intermediate values Sergei Golovan <sgolovan@gmail.com> - 2021-08-31 18:40 +0200
    Bug#993388: [Pkg-tcltk-devel] Bug#993388: tcl8.6: nested dicts: with lappend you can duplicate and than remove intermediate values Davide Prina <davide.prina@gmail.com> - 2021-09-03 20:50 +0200

csiph-web