title: What's the difference between "dofile" in lua and "luaL_dofile" in the C API?
body: <p>Using the Lua 5.3.4 C API, this works:</p>
  
  <pre><code>luaL_dostring(lua, "dofile('mnemonics.lua')");
  </code></pre>
  
  <p>But this fails to execute the file:</p>
  
  <pre><code>luaL_dofile(lua, "mnemonics.lua");
  </code></pre>
  
  <p>Instead, it reports "attempt to call a string value".</p>
  
  <p>When I replace it with</p>
  
  <pre><code>luaL_loadfile(lua, "mnemonics.lua");
  </code></pre>
  
  <p>it returns <code>LUA_OK</code>, but it doesn't push a function on the stack like it's supposed to. In fact, the stack is empty (<code>gettop</code> reports 0) afterwards.</p>
  
  <p>I can use the dostring workaround, but either I'm missing something, or there's a bug.</p>