#>>>>>>>>>list>>>>>>>
# list 可由数字,字符,字符串或者别的list组成
# <1> 创建一个list
set x "a b c"
# 结果:a b c
# <2> 通过index(0...)取list的某一个值,如取list x的第3个值
lindex $x 2
puts "item at index 2 of the list {$x} is : [lindex $x 2]\n"
# 结果:item at index 2 of the list {a b c} is : c
# <3> 获取list的长度
llength $x
# 结果:3
# <4> 分割list,用split list "<符号>"
set y [split 1/2/4434/dfdf "/"]
# 结果:1 2 4434 dfdf
# > 下面两个list是不同的,通过花括号括起来的属于list的一个元素
set b [list a b {c d e} {f {g h}}]
# a b {c d e} {f {g h}}
# > 而通过split分隔开(默认是空格)是独立的元素
set a [split "a b {c d e} {f {g h}}"]
# a b \{c d e\} \{f \{g h\}\}
lindex $b 0
# a
lindex $a 0
# a
lindex $b 3
# f {g h}
lindex $a 3
#d
# > 两个list的index = 3的元素即可证明。
# <5> 分清哪个是list的item !!!
set str x/y/z/144
# 结果:x/y/z/144
# > 创建一个str为”x/y/z/144“
lindex [split $str "/"] 2
# 结果:z
# > 将原来的str根据符号”/“分割,本质上是创建了第二个list: "x y z 144",所以lindex ... 2 取到的是z
lin