Version 18 of struct

Updated 2003-07-28 16:33:46

Documentation can be found for various (tcllib) data structures.Provided structures, so far:

How is the tcllib struct::list going to work - I presume that it can't be namespace import'd to replace the core's list command? Is there anything that can be done to prevent this from accidentally happening?

DGP Did you try it? [namespace import] throws an error on any attempt to import a command that already exists in the target namespace. Why would you want to muck with the global namespace anyway? Just import [struct::list] into your own namespace, if you want to make use of it by the simple name list rather than the fully qualified ::struct::list.

You are writing code in your own namespace, right?

Often what people want from "struct" is a C-like datatype. This is much different from the tcllib data structures described above. Various people have coded Tcl extensions for this kind of "struct"; Iain B. Findleton's Containers appears to be a very nice data structure extension that includes one.

Many people have written small procs that implement a C like structure facility in Tcl. Check google nearly monthly for discussions. Here's a thread [L1 ] that covers one nice implementation.

The first exchange in that thread is also here at C Struct is Tcl!

And of course, now tcllib has record - which provides that type of functionality!

Category Package, subset Tcllib