From Newsgroup: comp.lang.tcl
Am 11.03.2026 um 19:24 schrieb Jacob:
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 %
You are probably using a custom package, that's overwritting the lremove command. Look out in you Tcl lib directory for the packages. I would
open all *.tcl files with my text editor and use the find function over
all opened files.
--- Synchronet 3.21d-Linux NewsLink 1.2