Skip to content
Tcl Source Code Artifact [5f4b401716]
Login

Artifact [5f4b401716]

Artifact 5f4b401716a8d9bbec200a0e75e58ad4d7ada0688614fb30468df68903548436:

Wiki page [TclX Commands] by dkf on 2025-07-01 09:01:21.
D 2025-07-01T09:01:21.208
L TclX\sCommands
N text/x-markdown
P 17520cfe6993b47180896c72a39aedb7a79190439f2aa79105c6d48f280001f2
U dkf
W 7623
# A Survey of TclX Command Status

One of the most fruitful sources of future commands for Tcl has been Karl Lehenbauer's TclX extension. This is a short survey of the bits and pieces that remain there to help us identify candidates for possible future TIPs. Often the pattern of how the commands work changes when they're TIPped.

They're organised by (abbreviated) category from the manual page (except for `mainloop` which is miscategorised).

----

| Category | Command | Obsolete | Notes (core command) | Candidate for future TIP
| -------- | ------- | :------: | -------------------- | :----------------------:
| **GENERAL** | `commandloop` | | | ?
| | `coalesce` | | | Y
| | `dirs` | | |
| | `echo` | Y | `puts` | N/A
| | `infox` | | mostly irrelevant |
| | `for_array_keys` | Y | `array names`+`foreach` (for technical reasons) | N/A
| | `for_recursive_glob` | | | ? (script)
| | `loop` | Y | `for` or `foreach`+`lseq` | N/A
| | `mainloop` | | | ?
| | `popd` | | |
| | `pushd` | | |
| | `recursive_glob` | | | ? (script)
| | `showproc` | | |
| | `try_eval` | Y | `try` | N/A
| **DEBUGGING** | `cmdtrace` | | check `trace add command` |
| | `edprocs` | | |
| | `profile` | | |
| | `profrep` | | |
| | `saveprocs` | | |
| **POSIX** | `alarm` | | | Y
| | `execl` | Y | `exec` (except in edge cases) | ?
| | `chroot` | | | ?
| | `fork` | | | ? (messy)
| | `id` | | | Y
| | `kill` | | | Y
| | `link` | Y | `file link` | N/A
| | `nice` | | | Y
| | `readdir` | Y | `glob` |
| | `signal` | | | Y
| | `sleep` | Y | `after` |
| | `system` | Y | `exec` (typically) |
| | `sync` | | | Y
| | `times` | | | Y
| | `umask` | | | Y
| | `wait` | Y | `tcl::process status -wait` |
| **FILE** | `bsearch` | | |
| | `channelfd` | | |
| | `chmod` | | | Y
| | `chown` | | | Y
| | `chgrp` | | | Y
| | `dup` | | | ?
| | `fcntl` | | see `chan configure` |
| | `flock` | | | Y
| | `for_file` | Y | `foreachLine` | N/A
| | `funlock` | | | Y
| | `fstat` | Y | `chan configure -stat` (for files) | N/A
| | `ftruncate` | Y | `chan truncate` | N/A
| | `lgets` | | |
| | `pipe` | Y | `chan pipe` | N/A
| | `read_file` | Y | `readFile` | N/A
| | `select` | Y | `chan event`+`vwait` (different abstraction) | N/A
| | `write_file` | Y | `writeFile` | N/A
| **NETWORK** | `host_info` | | | ?
| **SCANNING** | `scancontext` | | |
| | `scanfile` | | |
| | `scanmatch` | | |
| **MATH** | `abs` | Y | `tcl::mathfunc::abs` | N/A
| | `acos` | Y | `tcl::mathfunc::acos` | N/A
| | `asin` | Y | `tcl::mathfunc::asin` | N/A
| | `atan` | Y | `tcl::mathfunc::atan` | N/A
| | `atan2` | Y | `tcl::mathfunc::atan2` | N/A
| | `ceil` | Y | `tcl::mathfunc::ceil` | N/A
| | `cos` | Y | `tcl::mathfunc::cos` | N/A
| | `cosh` | Y | `tcl::mathfunc::cosh` | N/A
| | `double` | Y | `tcl::mathfunc::double` | N/A
| | `exp` | Y | `tcl::mathfunc::exp` | N/A
| | `floor` | Y | `tcl::mathfunc::floor` | N/A
| | `fmod` | Y | `tcl::mathfunc::fmod` | N/A
| | `hypot` | Y | `tcl::mathfunc::hypot` | N/A
| | `int` | Y | `tcl::mathfunc::int` | N/A
| | `log10` | Y | `tcl::mathfunc::log10` | N/A
| | `log` | Y | `tcl::mathfunc::log` | N/A
| | `max` | Y | `tcl::mathfunc::max` | N/A
| | `min` | Y | `tcl::mathfunc::min` | N/A
| | `pow` | Y | `tcl::mathfunc::pow` | N/A
| | `random` | Y | `tcl::mathfunc::random` | N/A
| | `round` | Y | `tcl::mathfunc::round` | N/A
| | `sin` | Y | `tcl::mathfunc::sin` | N/A
| | `sinh` | Y | `tcl::mathfunc::sinh` | N/A
| | `sqrt` | Y | `tcl::mathfunc::sqrt` | N/A
| | `tan` | Y | `tcl::mathfunc::tan` | N/A
| | `tanh` | Y | `tcl::mathfunc::tanh` | N/A
| **LISTS** | `intersect` | | | Y
| | `intersect3` | | | ?
| | `lassign` | Y | `lassign` | N/A
| | `lcontain` | Y | `in` operator | N/A
| | `lempty` | Y | `![llength $list]` | N/A
| | `lmatch` | Y | `lsearch -all -inline` | N/A
| | `lrmdups` | | | ?
| | `lvarcat` | Y | `lappend var {*}$thing...` | N/A
| | `lvarpop` | Y | `lpop 0` (it has different defaults) | N/A
| | `lvarpush` | Y | `ledit -1 -1` | N/A
| | `union` | | | Y
| **KEYED LISTS** | `keyldel` | Y | `dict remove`/`dict unset` (approx) | [TP](#TP)
| | `keylget` | Y | `dict get` (approx) | [TP](#TP)
| | `keylkeys` | Y | `dict keys` (approx) | [TP](#TP)
| | `keylset` | Y | `dict replace`/`dict set` (approx) | [TP](#TP)
| **STRINGS** | `ccollate` | Y | `string compare` (approx) |
| | `cconcat` | Y | `string cat` | N/A
| | `cequal` | Y | `string equal` | N/A
| | `cindex` | Y | `string index` | N/A
| | `clength` | Y | `string length` | N/A
| | `crange` | Y | `string range` | N/A
| | `csubstr` | Y | `string range` (approx) | N/A
| | `ctoken` | | | Y
| | `ctype` | Y | `string is` | N/A
| | `replicate` | Y | `string repeat` | N/A
| | `translit` | | sort of like `string map` but not exactly |
| **MSGCAT** | `catclose` | Y | `msgcat` package | N/A
| | `catgets` | Y | `msgcat` package | N/A
| | `catopen` | Y | `msgcat` package | N/A
| **HELP** | `apropos` | | |
| | `help` | | |
| | `helpcd` | | |
| | `helppwd` | | |
| **PACKAGES** | `auto_commands` | Y | `package`, `tm` | N/A
| | `auto_load_file` | Y | `package`, `tm` | N/A
| | `auto_packages` | Y | `package`, `tm` | N/A
| | `buildpackageindex` | Y | `package`, `tm` | N/A
| | `convert_lib` | Y | `package`, `tm` | N/A
| | `loadlibindex` | Y | `package`, `tm` | N/A
| | `searchpath` | Y | `package`, `tm` | N/A

<a name="TP">TP:</a> The Thread package needs converting to dicts.

# A Plan of Future Workpackages
Note that these represent potentially multi-TIP themes.

## Utilities: Basic Types
| TclX Name | Preferred Implementation Option |
| --------- | ------------------------------- |
| `coalesce` | interpreted + bytecoded |
| `ctoken` | interpreted (new abstract list type?) |
| `intersect` | interpreted |
| `intersect3` | interpreted |
| `lrmdups` | interpreted + bytecoded |
| `union` | interpreted |

## Utilities: Standard Procedures
| TclX Name | Preferred Implementation Option |
| --------- | ------------------------------- |
| `commandloop` | scripted? |
| `for_recursive_glob` | scripted |
| `lgets` | scripted? |
| `mainloop` | scripted? |
| `recursive_glob` | scripted |

## Posix: Process Launch
| TclX Name | Preferred Implementation Option |
| --------- | ------------------------------- |
| `execl` | New non-ambiguous command to complement `exec`; interpreted | 
| `fork` | A mighty can of worms! interpreted |

## Posix: Signals
| TclX Name | Preferred Implementation Option |
| --------- | ------------------------------- |
| `alarm` | interpreted |
| `kill` | interpreted (in `tcl::process`?) |
| `signal` | interpreted |

## Posix: Information Query
| TclX Name | Preferred Implementation Option |
| --------- | ------------------------------- |
| `id` | interpreted |
| `times` | interpreted |
| `host_info` | interpreted |

## Posix: File Operations
| TclX Name | Preferred Implementation Option |
| --------- | ------------------------------- |
| `chroot` | interpreted |
| `chmod` | interpreted |
| `chown` | interpreted |
| `chgrp` | interpreted |
| `nice` | interpreted |
| `sync` | interpreted |
| `umask` | interpreted |

## Posix: Channel Operations
| TclX Name | Preferred Implementation Option |
| --------- | ------------------------------- |
| `dup` | not sure we need this; interpreted (in `chan`) |
| `flock` | `chan lock`? |
| `funlock` | `chan unlock`? |

## Posix: Tidying Up
| TclX Name | Preferred Implementation Option |
| --------- | ------------------------------- |
| `fcntl` | see `chan configure` to check for missing bits |

Z c2bc844abf83d0b07169517ba262b2d8