tomdagliusa
Programmer
Hi,
I prefer to write my procs so they accept a list on the call. This way, I can either key on certain attributes of the list to make decisions within the proc. This also has the added advantage of not requiring me to change any calls to the proc, as long as I make the changes backwards compatible. So instead of:
proc aProc {a b c} {
doSomething $a
if {$b == $someValue} {
.....
}
}
I have:
proc aProc {aList} {
if {[llength $aList] == $someSize} {
doThis [lindex $aList 2]
if {[lindex $aList 7] == $srcAddrDutIf1} {
doThat [lindex $aList 1] [lindex $aList 4]
}
}
Or, is it 6 of one, half dozen of the other?
Tom
I prefer to write my procs so they accept a list on the call. This way, I can either key on certain attributes of the list to make decisions within the proc. This also has the added advantage of not requiring me to change any calls to the proc, as long as I make the changes backwards compatible. So instead of:
proc aProc {a b c} {
doSomething $a
if {$b == $someValue} {
.....
}
}
I have:
proc aProc {aList} {
if {[llength $aList] == $someSize} {
doThis [lindex $aList 2]
if {[lindex $aList 7] == $srcAddrDutIf1} {
doThat [lindex $aList 1] [lindex $aList 4]
}
}
Or, is it 6 of one, half dozen of the other?
Tom