1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
|
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
# 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.
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)
| -------- | ------- | :------: | -----
| **GENERAL** | `commandloop` | |
| | `coalesce` | |
| | `dirs` | |
| | `echo` | Y | `puts`
| | `infox` | | mostly irrelevant
| | `for_array_keys` | Y | `array names` + `foreach` (for technical reasons)
| | `for_recursive_glob` | |
| | `loop` | Y | `for` or `foreach`+`lseq`
| | `mainloop` | |
| | `popd` | |
| | `pushd` | |
| | `for_recursive_glob` | |
| | `showproc` | |
| | `try_eval` | Y | `try`
| **DEBUGGING** | `cmdtrace` | |
| | `edprocs` | |
| | `profile` | |
| | `profrep` | |
| | `saveprocs` | |
| **POSIX** | `alarm` | |
| | `execl` | Y | `exec` (except in edge cases)
| | `chroot` | |
| | `fork` | |
| | `id` | |
| | `kill` | |
| | `link` | Y | `file link`
| | `nice` | |
| | `readdir` | Y | `glob`
| | `signal` | |
| | `sleep` | Y | `after`
| | `system` | Y | `exec` (typically)
| | `sync` | |
| | `times` | |
| | `umask` | |
| | `wait` | Y | `tcl::process status -wait`
| **FILE** | `bsearch` | |
| | `channelfd` | |
| | `chmod` | |
| | `chown` | |
| | `chgrp` | |
| | `dup` | |
| | `fcntl` | | see `chan configure`
| | `flock` | |
| | `for_file` | Y | `foreachLine`
| | `funlock` | |
| | `fstat` | Y | `chan configure -stat` (for files)
| | `ftruncate` | Y | `chan truncate`
| | `lgets` | |
| | `pipe` | Y | `chan pipe`
| | `read_file` | Y | `readFile`
| | `select` | Y | `chan event`+`vwait` (different abstraction)
| | `write_file` | Y | `writeFile`
| **NETWORK** | `host_info` | |
| **SCANNING** | `scancontext` | |
| | `scanfile` | |
| | `scanmatch` | |
| **MATH** | `abs` | Y | `tcl::mathfunc::abs`
| | `acos` | Y | `tcl::mathfunc::acos`
| | `asin` | Y | `tcl::mathfunc::asin`
| | `atan` | Y | `tcl::mathfunc::atan`
| | `atan2` | Y | `tcl::mathfunc::atan2`
| | `ceil` | Y | `tcl::mathfunc::ceil`
| | `cos` | Y | `tcl::mathfunc::cos`
| | `cosh` | Y | `tcl::mathfunc::cosh`
| | `double` | Y | `tcl::mathfunc::double`
| | `exp` | Y | `tcl::mathfunc::exp`
| | `floor` | Y | `tcl::mathfunc::floor`
| | `fmod` | Y | `tcl::mathfunc::fmod`
| | `hypot` | Y | `tcl::mathfunc::hypot`
| | `int` | Y | `tcl::mathfunc::int`
| | `log10` | Y | `tcl::mathfunc::log10`
| | `log` | Y | `tcl::mathfunc::log`
| | `max` | Y | `tcl::mathfunc::max`
| | `min` | Y | `tcl::mathfunc::min`
| | `pow` | Y | `tcl::mathfunc::pow`
| | `random` | Y | `tcl::mathfunc::random`
| | `round` | Y | `tcl::mathfunc::round`
| | `sin` | Y | `tcl::mathfunc::sin`
| | `sinh` | Y | `tcl::mathfunc::sinh`
| | `sqrt` | Y | `tcl::mathfunc::sqrt`
| | `tan` | Y | `tcl::mathfunc::tan`
| | `tanh` | Y | `tcl::mathfunc::tanh`
| **LISTS** | `intersect` | |
| | `intersect3` | |
| | `lassign` | Y | `lassign`
| | `lcontain` | Y | `in` operator
| | `lempty` | |
| | `lmatch` | Y | `lsearch -all -inline`
| | `lrmdups` | |
| | `lvarcat` | Y | `lappend var {*}$thing...`
| | `lvarpop` | Y | `lpop` (though different defaults)
| | `lvarpush` | Y | `ledit -1 -1`
| | `union` | |
| **KEYED LISTS** | `keyldel` | Y | `dict remove`/`dict unset` (approx)
| | `keylget` | Y | `dict get` (approx)
| | `keylkeys` | Y | `dict keys` (approx)
| | `keylset` | Y | `dict replace`/`dict set` (approx)
| **STRINGS** | `ccollate` | Y | `string compare` (approx)
| | `cconcat` | Y | `string cat`
| | `cequal` | Y | `string equal`
| | `cindex` | Y | `string index`
| | `clength` | Y | `string length`
| | `crange` | Y | `string range`
| | `csubstr` | Y | `string range` (approx)
| | `ctoken` | |
| | `ctype` | Y | `string is`
| | `replicate` | Y | `string repeat`
| | `translit` | | sort of like `string map` but not exactly
| **MSGCAT** | `catclose` | Y | `msgcat` package
| | `catgets` | Y | `msgcat` package
| | `catopen` | Y | `msgcat` package
| **HELP** | `apropos` | |
| | `help` | |
| | `helpcd` | |
| | `helppwd` | |
| **PACKAGES** | `auto_commands` | Y | `package`, `tm`
| | `auto_load_file` | Y | `package`, `tm`
| | `auto_packages` | Y | `package`, `tm`
| | `buildpackageindex` | Y | `package`, `tm`
| | `convert_lib` | Y | `package`, `tm`
| | `loadlibindex` | Y | `package`, `tm`
| | `searchpath` | Y | `package`, `tm`
| 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 |
|