title: Create Lua function from string
body: <p>I am creating functions (of x) from a string in Lua. The code I am using is</p>
  
  <pre><code>function fcreate(fs)
   return assert(loadstring("return function (x) return " .. fs.." end"))()
  end
  </code></pre>
  
  <p>This works for globals, e.g. </p>
  
  <pre><code>u=fcreate("math.sin(x)")
  </code></pre>
  
  <p>does the right thing.</p>
  
  <p>However, it does not seem to like local variables. So</p>
  
  <pre><code>local c=1
  u=fcreate("math.sin(x)+c")
  </code></pre>
  
  <p>will not work because c is local.</p>
  
  <p>Is this fixable?</p>