This is not necessarily the current version of this TIP.
| TIP: | 371 |
| Title: | Improvements for the dict command |
| Version: | $Revision: 1.2 $ |
| Author: | Thomas Perschak <tombert at gmx dot at> |
| State: | Draft |
| Type: | Project |
| Tcl-Version: | 8.7 |
| Vote: | Pending |
| Created: | Thursday, 05 August 2010 |
The dict command is limited by allowing manipulation of only the first level of key elements. Not only should the dict get accept a nested key list, but also the other commands like dict replace.
The following line:
dict get {-range {-values {a b c} -base M} -name myname} \
-range -base
Results in:
M
But how to change the base? I suggest the following dict syntax extension:
dict replace {-range {-values {a b c} -base M} -name myname} \
{-range -base} k
Results in:
-range {-values {a b c} -base k} -name myname
Allowing a nested key list would not break any previous code, but substantially improve the dict command.
The dict command is the basis for handling database like structures. By allowing nested keys this would give more freedom in organizing these structures like the example above.
This document has been placed in the public domain.
This is not necessarily the current version of this TIP.