user wrote:strikelight wrote:
Code: Select all
proc istclcommand {command} { return [expr {[info commands $command] != ""}] }
Using return at the end of the proc when the last comman executed returned what you want returned from the proc serves no purpose but slowing the execution down a bit. And how about a proc with glob matching chars in the name? (just being a grumpy old man tonight ;P)
In english, por favor?
Edit: I think i get what you mean... I'll give you that one..
Code: Select all
proc istclcommand {command} { expr {[info commands $command] != ""} }
Although, the 'return' is generally used for proper symantic rules.
strikelight wrote:
Reading line by line is alot slower than reading all the data at once...
user wrote:
Reading the entire file into memory without checking the size? I think a combination of your procs would be good...with a max size set some where

On todays computers, and the general text file, this isn't even an issue.
And even if it was, there is no combination that would make it more efficient.. The only thing that would add any sort of benefit, would be a max size check, if it were even an issue on today's computers.