lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I have implemented "import" function in Lua.

function import (module_name)
  require (module_name)
  local m = package.loaded [module_name]
  local fenv = getfenv (1)
  for k, v in pairs (m) do fenv [k] = v end

I want to implement this function in C. 
Can someone give me a hint on how I can copy the contents of one array to another?

Karol Drożak