Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2010-05-20
15:09 • Ticket [3004007fff] list->dict representation handling error status still... artifact: 3bbdcbe26b user: dkf
15:06 • Ticket [3004007fff]: 5 changes artifact: 6e90dac0eb user: dkf
04:55 • Ticket [3004007fff]: 5 changes artifact: c86a392fc6 user: ferrieux
04:21 • Closed ticket [3004007fff]. artifact: b70e635a1a user: ferrieux
2010-05-19
11:24 • New ticket [3004007fff]. artifact: 21b0a00d47 user: msofer

list->dict representation handling error

Closed / Fixed3004007fffffffffffffffffffffffffffffffffCreated 17 years agoUpdated 17 years ago
Descriptionplain2010-05-19 11:24:24
(see http://groups.google.com/group/comp.lang.tcl/browse_thread/thread/6a3416f438b78a20#)

  % set a [list 1 b 1 c 2 a]; dict exists $a 1; set a 
  1 c 2 a 
  % set b [list 1 b 1 c 2 a] 
  1 b 1 c 2 a 
  % dict exists $b 1 
  1 
  % set b 
  1 b 1 c 2 a 
  % set c [list 1 b 1 c 2 a]; dict exists $c 1 
  1 
  % set c 
  1 c 2 a 
  % set d [list 1 b 1 c 2 a] 
  1 b 1 c 2 a 
  % dict exists $b 1; set d 
  1 b 1 c 2 a 
  %
ferrieuxplain2010-05-20 04:21:58
Actually this was already fixed on by dkf on 2010-02-24:

2010-02-24  Donal K. Fellows  <[email protected]>

* generic/tclDictObj.c (SetDictFromAny): Prevent the list<->dict
* generic/tclListObj.c (SetListFromAny): conversion code from taking
too many liberties. Stops loss of duplicate keys in some scenarios.
Many thanks to Jean-Claude Wippler for finding this.

Too bad that this wasn't recorded as a bona fide bug. Marking as duplicate anyway.

Maybe this should be backported to the 8.5 branch ?
ferrieuxplain2010-05-20 04:55:57
Added a test, and backported to 8.5.
dkfplain2010-05-20 15:06:08
allow_comments - 1
dkfplain2010-05-20 15:09:27
There was no bug report because the reporter did not file one; they just bitched at me directly. I've had a lot of that since 8.6b1...
Log in (anonymous is fine) to add a comment.