title: Lua 'require' but files are only in memory
body: <p>Setting: I'm using Lua from a C/C++ environment. </p>
  
  <p>I have several lua files on disk. Those are read into memory and some more memory-only lua files become available during runtime. Think e.g. of an editor, with additional unsaved lua files.</p>
  
  <p>So, I have a <code>list&lt;identifier, lua_file_content&gt;</code> in memory. Some of these files have <code>require</code> statements in them. When I try to load all these files to a lua instance (currently via <code>lua_dostring</code>) I get <code>attempt to call global require (a nil value)</code>. </p>
  
  <p>Is there a possibility to provide a <code>require</code> function, which replaces the old one and just uses the provided in memory files (those files are on the C side)? </p>
  
  <p>Is there another way of allowing <code>require</code> in these files without having the required files on disk?</p>
  
  <p>An example would be to load the lua stdlib from memory only without altering it. (This is actually my test case.)</p>