RBTree is an extension that implements Red-Black trees, roughly a cross between an ordered list while having direct access features similar to array. RBTree was written by Philip Smolen. See also: Complex data structures
RBTree is avaliable at [L1 ] with source code at [L2 ]. Versions 1.1.2 and later are distributed under a Tcl BSD-style license.
From the README
Lars H (10 Jun 2003): Is this a correct description from the script point of view, or is it just what things look like from the C point of view? In general Tcl strings, nulls are encoded so that they don't terminate the C string. Is there some exception from this with respect to array indices?
The RBTree documentation is just a little out of date. In TCL 8.0 about 90% of the TCL core could use strings with embedded nulls. You could not use embedded nulls in array keys, and a few other places. Newer versions of TCL work better with embedded nulls.