TclX[http://tclx.sf.net/] is an essential package of extensions for Tcl, especially on [POSIX] systems like [Unix]. This package creates interpreters known as tcl. It adds: * advanced code loading facility, * new programming constructs, * debugging and profiling facilities, * unix access commands, * file I/O facilities including awk-like scanning for strings, * extended list and a new key list capability, * extended character and string manipulation commands, and * time and date manipulation commands. Extended Tcl is oriented towards system programming tasks and large application development. It provides a variety of additional interfaces to the underlying operating system, as well as many new programming constructs, text manipulation tools, and debugging capabilities. Over the years, a variety of features originally appeared in TclX, and then, as the ideas were proven, migrated to the Tcl core. These features include: * Tcl's I/O system, * its associative [array]s, * Internet networking interfaces, * [upvar], * memory debugging, * [incr] TclX includes documentation on: * debugging Tcl memory problems, * how to use its '''[keyed list]''' data type, * manipulating binary structures via handles, * a guide to writing Tcl commands in C, * a reference manual for the new TclX commands themselves. (Give an alternate description of TclX as Tcl augmented with POSIX stuff, such as [fork], plus other conveniences common among Unixoids, including keyed lists, profiling, [signal] and [kill], ...) ---- **Useful References** On SourceForge it can be found at http://sourceforge.net/projects/tclx * Please report bugs to http://sourceforge.net/bugs/?group_id=13247 * and place patches at http://sourceforge.net/patch/?group_id=13247 see ftp://ftp.tcl.tk/pub/tcl/nightly-cvs/ for a tar file of the sf.net cvs head . The [ActiveTcl] Batteries Included distribution includes TclX. [TclX Future] contains discussion about the interface and interaction between Tcl and TclX. [TclX Commands] has a list of TclX's commands. ---- **Evolution, State and History** [Karl Lehenbauer] first wrote TclX, and he and [Mark Diekhans] maintained it for a long time. In spring 2002, [Jeffrey Hobbs] is "reforming" TclX, although he doesn't "own" it. [JH]: TclX 8.4.0 was released on Nov 21, 2005. There is no more TkX (aka wishx) component or stand-alone binary ('tcl' exe) support. It is a true extension, now with better portability and a cleaner codebase. ---- **Replacement for wishx** Put this script, called wishx and marked executable, in your path: #!/bin/sh #\ exec wish "$0" ${1+"$@"} package require Tk package require Tclx set argv [lassign $argv argv0] source $argv0 ''Note: script fixed by [MS] after a bug report in clt [http://groups.google.com/group/comp.lang.tcl/browse_frm/thread/ac3da323fbc98717/8bbb2c39936cddc9#8bbb2c39936cddc9]'' [LV] I would replace the '''wish''' in the above script with [tclsh] myself. Also note that sometimes, when one installs the Tcl package in one of its variations, instead of a command called '''tclsh''' or '''wish''', a version number will be attached to the command name. For instance, one might find they have '''tclsh8.5.exe''' installed after installing a package. The simpler '''tclsh''' or '''tclsh.exe''' are often just shortcuts/symbolic links/copies of the other executable name, and in some cases, may not even exist. Also, note that the above script won't replace '''ALL''' the functionality of the original wishx. That is because in ''the old days'' when Tclx installed tcl and wishx, there was an interactive command line command called '''help''' that was installed, that provided a relatively simple interface to man page like information. The above script doesn't implement that. Shouldn't make a difference for programs expecting to run using wishx (or tcl) but if you are following an old tutorial from a book or some electronic source, you may notice the difference. Using [tclsh] or [wish], just use the [man] command to look up information about tcl sub-commands. ---- How many people use [TclX for Unix System Programming]? ---- See also [scanxxx without tclx] ---- [DKF]: TclX is useful when you're running [tclsh] in setuid or setgid mode, since it's [id] command can be used to perform the uid/gid changing often required when doing such things. ---- [TR] - The manual 'ObjCmdWrite.3' (TclCommandWriting - Writing C language extensions to Tcl) is a nice introduction to writing Tcl commands in C. In the 8.4 version there is an example for the reversal of a list, which is not only incomplete but also wrong. I liked the example as such, so here comes a correct version (not targeted at TclX but Tcl in general): ====== int lreverseCmd(ClientData notUsed, Tcl_Interp *interp, int objc,Tcl_Obj *const objv[]) { int listObjc, listIndex; Tcl_Obj **listObjv; char *temp, *resultList; Tcl_Obj *newListObjv; /* Verify argument count. Since we take only one argument, argument * count must be 2 (command plus one argument). */ if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "list"); return TCL_ERROR; } /* Create an object to handle the new list we're creating */ newListObjv = Tcl_NewObj(); /* Crack the list at objv[1] into its own count and array of object * pointers. */ if (Tcl_ListObjGetElements(interp, objv[1], &listObjc, &listObjv) != TCL_OK) { return TCL_ERROR; } /* For each element in the source list from last to first, append an * element to the new list. */ for (listIndex = listObjc - 1; listIndex >= 0; listIndex--) { Tcl_ListObjAppendElement (interp, newListObjv, listObjv[listIndex]); } Tcl_SetObjResult(interp,newListObjv); return TCL_OK; } ====== ---- [LV] you should submit the above as a bug fix on http://tclx.sf.net/ . Speaking of which - does anyone know if the TclX code is ever going to be updated so it no longer crashes when tested with tcl 8.5? Bug reports have been submitted. Perhaps the only real problem is in the test suite - it would be nice if the test suite didn't crash tcl though. ---- **List of commands** ***General*** [dirs] — [commandloop] — [echo] — [infox] — [for_array_keys] — [for_recursive_glob] — [loop] — [popd] — [pushd] — [recursive_glob] — [showproc] — [try_eval] ***Debugging and Development*** [cmdtrace] — [edprocs] — [profile] — [profrep] — [saveprocs] ***Unix Access*** [alarm] — [execl] — [chroot] — [fork] — [id] — [kill] — [link] — [nice] — [readdir] — [signal] — [sleep] — [system] — [sync] — [times] — [umask] — [wait] ***File*** [bsearch] — [chmod] — [chown] — [chgrp] — [dup] — [fcntl] — [flock] — [for_file] — [funlock] — [fstat] — [ftruncate] — [lgets] — [pipe] — [read_file] — [select] — [write_file] ***Network Programming*** [host_info] ***File Scanning*** [scancontext] — [scanfile] — [scanmatch] ***Math*** [max] — [min] — [random] ***List Manipulation*** [intersect] — [intersect3] — [lassign] — [lcontain] — [lempty] — [lmatch] — [lrmdups] — [lvarcat] — [lvarpop] — [lvarpush] — [union] ***Keyed Lists*** [keyldel] — [keylget] — [keylkeys] — [keylset] ***String and Character Manipulation*** [ccollate] — [cconcat] — [cequal] — [cindex] — [clength] — [crange] — [csubstr] — [ctoken] — [ctype] — [replicate] — [translit] ***XPG/3 Message Catalogs*** [catopen] — [catgets] — [catclose] ***Event-Driven Programming*** [mainloop] ***Help*** [help] — [helpcd] — [helppwd] — [apropos] ***Package Library Management*** [auto_commands] — [buildpackageindex] — [convert_lib] — [loadlibindex] — [auto_packages] — [auto_load_file] — [searchpath] ---- !!!!!! %| [Category Package%|%Package%|%] | [Category TclX%|%TclX%|%] | [Category Unix%|%Unix%|%] |% !!!!!!