lua-users home
lua-l archive

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


On 2013-08-22 12:59:13 +0000, Thijs Schreijer said:



-----Original Message-----

From: lua-l-bounces@lists.lua.org [mailto:lua-l-bounces@lists.lua.org] On

Behalf Of Philipp Kraus

Sent: donderdag 22 augustus 2013 13:02

To: list mailing Lua

Subject: module with c api


Hello,


I have got some modules (LUA script files) which are used with


local mymodul = require "mymodule"


All data is converted to a database, so each LUA script should be a row in


Is "data" the source code or the compiled byte code? In the latter case it is not portable, so be aware of that.


The database stores only source codes (no precompiled code).


Try loaders, see [1]. Create a loader that checks your database for the requested module and fetches it.

[1] http://www.lua.org/manual/5.1/manual.html#pdf-package.loaders


Do I understand it correct, that require uses also a table for the information of thre require data? So in my case

the require call must check the data first in my database eg

local mymodule = require "mymodule"


In this case in my database table a row exists with the name "mymodule", so can I cange the require, that it load

it from my database?


Thanks


Phil