title: lua 5.1 how to use loadstring to call a function that is not in global namespace AND requires arguments
body: <p>trying to create a wrapper function to call various validation functions.  The validation functions are not in the global namespace AND they require parameters.  I'm using Lua 5.1 and trying to get the loadstring() function to work but not having any luck.</p>
  
  <pre><code>-- wrapper function
  local function validateField(funcName, funcArg, errorTable)
      local vres
      local functionCall = loadstring("return " .. funcName .. "(...)")
  
      vres = functionCall(funcArg)
  
      if vres~=true then
          table.insert(errorTable, vres)
          return false
      end
      return true
  end
  </code></pre>
  
  <p>calling code:</p>
  
  <pre><code>local result = validateField("valid.nameField" , data.name, errors)
  </code></pre>