title: Add an opening brace to the beginning of a list in tcl
body: <p>I am trying to find the Cartesian product of two sets in tcl. My logic is ready, but I need to beautify the output and put an opening brace at the beginning of the list. I am able to append at the end by using <strong>append</strong> command, but it is throwing up error while doing so for the beginning of the list. Following is the code :</p>
  <pre><code>set a {0 1}
  set b {1 2 3}
  set s {}
  append s &quot;\{&quot;                                              ### this is where the problem is
  for {set i 0} { $i &lt; 2 } {incr i} {
           for {set j $i} { $j &lt; 2 } {incr j} {
                    set x &quot;([lindex $a $i],[lindex $b $j])&quot;
                    lappend s &quot;$x,&quot;
                    
           }
           if {$j == 2} {
                    set x &quot;([lindex $a $i],[lindex $b $j])&quot;
                    lappend s &quot;$x&quot;
                 }
        }
        append s }
        puts $s
  </code></pre>
  <p>Now using</p>
  <pre><code>append s &quot;\{&quot; 
  </code></pre>
  <p>gives</p>
  <pre><code>unmatched open brace in list
  </code></pre>
  <p>On the other hand, using</p>
  <pre><code>append s &quot;\\{&quot;
  </code></pre>
  <p>gives the following output :</p>
  <pre><code>\{ (0,1), (0,2), (0,3) (1,2), (1,3)}
  </code></pre>
  <p>Is there a way I can remove the first slash and the space between the opening brace and the first parenthesis?</p>