So I’ve got a list, and in TCL the items are stored as {“1” “2” “3”}, space seperated. I’d like to convert this list to being {“1″,”2″,”3”} — what would be an efficient way of doing this, aside from going through a foreach and lappending , to the end of each item?
Thanks!
Your question doesn’t really make sense to me. In TCL, lists are stored internally as strings. When you say you want to list to {“1″,”2″,”3”}, I can only assume you are referring to the external display of the list. That can be done using the join command as follows:
1 2 3
{“1″,2″,3”}