lua-users home
lua-l archive

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


On 04/30/2014 08:58 AM, Igor Trevisan wrote:
Hi all,
I'm a Lua newbie and this is my first email to the list.
I'm working wiht Lua into and embedded system where the main
application is written in C and Lua is used to configure part
of the system activities.
I'm currently alble to load and execute a Lua script, loading it
from a USB stick.
What I'm now trying to do is execute a Lua function that uses an
external module I wrote.
So I have to load more than a single Lua file.
I know that I could compile file_1.lua, file_2.lua, ..., file_n.lua
and meld them in a  single bytecode but, just as an experiment,
I would like to work with different lua files (text format, no bytecode).
Is there a way to load and execute from my C program a Lua
fuction which is "distributed" in more than a Lua text file?
Without melding the files in a single bytecode?
I hope I was clear enough (if I wasn't please, tell me and I'll ry to explain again and better!) and that somebody out there can give me
some suggestions.
Thanks a lot in advance,
Igor.
Hi,
I am not sure if I understand you right. Do you want to have a single Lua function split over into several files, or do you want to have a single program split over several files?

Both is possible, but the first is actually rather unusual. If you need to split a single function over several files, there is certainly something wrong with your coding style ;-)

If you could clarify which of the two above you want I would try to show you how either is done.
--
Thomas