Posted to tcl by florentis at Wed Oct 14 13:44:59 GMT 2026view raw
- # TIP 764 example
- # Strings can keep their atomicity :
- set A {Hello World}
- set B {What's up doc ?}
- set {list.string}L $A $B
- foreach e $L {
- foreach f $e {
- puts "[type get $f] : $f"
- }
- }
- # string : hello World
- # string : How are you ?
- # Usual Tcl
- # strings are parsed as sublists
- set G [list $A $B]
- foreach e $G {
- foreach f $e {
- puts "[type get $f] : $f"
- }
- }
- # : hello
- # : World
- # : How
- # : are
- # : you
- # : ?
Add a comment