Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2004-09-30
03:13 • Deleted ticket [1037242fff]: Inconsistency in 'dict set' plus 2 othe... artifact: 1b19fd5d05 user: muehlebachs
2004-09-29
19:47 • New ticket [1037242fff]. artifact: 7ed4fa37d0 user: muehlebachs

Inconsistency in 'dict set'

Deleted1037242fffffffffffffffffffffffffffffffffCreated 22 years agoUpdated 22 years ago
Descriptionplain2004-09-29 19:47:49
The goal is to create a nested dictionary (foo) with
the following mappings:

    a -> A
    bc -> b -> B
    bc -> c -> C

One would expect to do it by:

    dict set foo a A
    dict set foo bc b B
    dict set foo bc c C

But this leads to the error (key "bc" not known in
dictionary). Instead it has to be done by:

    dict set foo a A
    dict set foo bc [dict create b B c C]

After the mappings are created, the values can be
changed by:

    dict set foo a AA
    dict set foo bc b BB
    dict set foo bc c CC

The different treatment of mappings at the 'top level'
and at a 'lower level' should either be
removed/corrected or mentioned in the docu.
muehlebachs Deleted ticket [1037242fff]. [History diff]2004-09-30 03:13:00
Log in (anonymous is fine) to add a comment.