I'm looking at documentation for lremove and it says it removes by
index. However, it appears to remove by a string match. Am I crazy? Is
the documentation wrong or is the command implemented wrongly?
Well I wrote this then answered my own question. Tkcon appears to
override the built-in lremove command with a different one. FYI.
(bin) 50 % info body lremove
-a-a-a array set opts {-all 0 pattern -exact}
-a-a-a while {[string match -* [lindex $args 0]]} {
-a-a-a-aswitch -glob -- [lindex $args 0] {
-a-a-a-a-a-a-a -a*-a-a-a { set opts(-all) 1 }
-a-a-a-a-a-a-a -g*-a-a-a { set opts(pattern) -glob }
-a-a-a-a-a-a-a -r*-a-a-a { set opts(pattern) -regexp }
-a-a-a-a-a-a-a ---a-a-a { set args [lreplace $args 0 0]; break }
-a-a-a-a-a-a-a default {return -code error "unknown option \"[lindex $args 0]\""}
-a-a-a-a}
-a-a-a-aset args [lreplace $args 0 0]
-a-a-a }
-a-a-a set l [lindex $args 0]
-a-a-a foreach i [join [lreplace $args 0 0]] {
-a-a-a-aif {[set ix [lsearch $opts(pattern) $l $i]] == -1} continue
-a-a-a-aset l [lreplace $l $ix $ix]
-a-a-a-aif {$opts(-all)} {
-a-a-a-a-a-a-a while {[set ix [lsearch $opts(pattern) $l $i]] != -1} {
-a-a-a-a-a-a-a set l [lreplace $l $ix $ix]
-a-a-a-a-a-a-a }
-a-a-a-a}
-a-a-a }
-a-a-a return $l
(bin) 51 %
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 65 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 04:36:58 |
| Calls: | 862 |
| Files: | 1,311 |
| D/L today: |
921 files (14,318M bytes) |
| Messages: | 264,528 |