title: In Expect script, how do you perform simple math and assign the result to a variable?
body: <p>Learning this language has been difficult because of the very particular syntax required. Everything needs a strange set of braces or brackets or quotes, and I'm pulling out my hair trying to keep it all straight. I can find examples of everything I already know how to do, and I can even find partial examples of what I'm trying to do, but apparently this is such a simple and beginner thing that nobody has bothered to demonstrate it. Either that or I am getting old and I am losing my Google-fu.</p>
  <p>I have two variables, thing1 and thing2. I have abandoned my actual code until I figure out how to do 2 + 2, so for now the value of thing1 is 2 and the value of thing2 is 2. I have tried:</p>
  <pre><code>set thing_total expr thing1+thing2
  set thing_total expr (thing1+thing2)
  set thing_total expr [thing1+thing2]
  set thing_total expr {thing1+thing2}
  set thing_total expr [ thing1+thing2 ]
  set thing_total expr [ thing1 + thing2 ]
  set thing_total [expr $thing1+$thing2]
  set thing_total [expr ($thing1+$thing2)]
  set thing_total [expr {$thing1+$thing2}]
  set thing_total [expr [ $thing1 + $thing2 ] ]
  </code></pre>
  <p>plus a bunch more that I'm not gonna bother to list. Can someone please tell me how to do math and assign the result to a variable? Don't care about floating point or integer or anything to do with data types.</p>