#!/usr/local/bin/tclsh #/usr/local/bin/wish -f #wm withdraw . ;# OUTPUT set a [list a b c] set b [list d e f] set c [concat $a $b] puts $c ;# a b c d e f set a "$a $b" puts $a ;# a b c d e f set b [join $a |] puts $b ;# a|b|c|d|e|f set b [lappend a h i j] puts $b ;# a b c d e f h i j puts $a ;# a b c d e f h i j puts [lindex $a 2] ;# c set a [linsert $a 3 x y z] puts $a ;# a b c x y z d e f h i j puts [llength $a] ;# 12 puts [lrange $a 3 5] ;# x y z set a [lreplace $a 3 5 X Y Z] puts $a ;# a b c X Y Z d e f h i j puts [lsearch -exact $a X] ;# 3 set b {a b {puts hello} c} puts $b ;# a b {puts hello} c set b [list a b {puts hello} c] puts $b ;# a b {puts hello} c puts [llength $b] ;# 4 set c [lrange $b 2 2] puts $c ;# {puts hello} set d [lindex $b 2] puts $d ;# puts hello eval $d ;# hello #exit