I have a question regarding to the following lines:
set list1 "1 2 3 4 5 6" ##line 1
set list2 {1 2 3 4 5 6} ##line 2
are these two lines both declare a list?
what is the difference between them?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In your specific example, there is no difference.
Neither really declare a list, as you cannot really declare a list in Tcl. But both set your variables to a valid list representation.
The difference only is visible if your items are special to the parser in any way, when “” allows replacements, while {} keeps the content unreplaced.
A third alternative woulde be: