Posted to tcl by hypnotoad at Tue Jun 18 16:39:03 GMT 2019view raw
proc cols list {
set level 0
set col $list
while {[llength$col]} {
set col [lindex$col 0]
incr level
if {$level > 100} break ; # safety
}
return$level
}
Comments
Posted by rkeene at Tue Jun 18 16:46:09 GMT 2019 [text][code]
proc isEmptyListNested list {
set level 0
set col $list
while 1 {
if {[llength $col] > 1} { return false }
if {[llength $col] < 1} { return true }
set col [lindex $col 0]
incr level
if {$level > 100} break ; # safety
}
return $level
}
Comments
Posted by rkeene at Tue Jun 18 16:46:09 GMT 2019 [text] [code]
proc isEmptyListNested list { set level 0 set col $list while 1 { if {[llength $col] > 1} { return false } if {[llength $col] < 1} { return true } set col [lindex $col 0] incr level if {$level > 100} break ; # safety } return $level }