title: How to declare a variable without initting it to nil in Lua?
body: <p>I've found it very useful to do something like:</p>
  
  <pre><code>if not variable then
      variable = value
  end
  </code></pre>
  
  <p>Of course, I'd usually rather that variable was local, but I can't declare it local in my if, or it won't be accessible.</p>
  
  <p>So sometimes I do:</p>
  
  <pre><code>local variable
  if not variable then
      variable = value
  end
  </code></pre>
  
  <p>The problem is that when I iterate over this code, the variable declaration sets the variable equal to nil. If I can live with a global value (I can), I can get around it by just not declaring the variable outside of the if block.</p>
  
  <p>But isn't there some way that I can both have my local value and let it keep its value?</p>