> Creating a TCL-accessible array in a C module is trival. Just pass
> the name of the TCL array variable to the C module, then in the C
> code, do:
>
> if (Tcl_SetVar2(interp, arrayname, subscript, val,
> TCL_LEAVE_ERR_MSG) == NULL) {
> return TCL_ERROR;
> }
>
> Args 2-4 are just simple strings. The array name you pass to C can be
> an ns_share, a local, a global, etc. We had a small TCL routine that
> scanned a large text file and set an ns_share array. It was taking
> several minutes to run. With C, it ran 10x faster.
You can also watch entire arrays with Tcl_TraceVar, which has an
obj-ified version in 8.4.
Jeff