lua-users home
lua-l archive

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


Hi Steve,
 
thanks for your answer.


On 30 April 2014 09:14, steve donovan <steve.j.donovan@gmail.com> wrote:
On Wed, Apr 30, 2014 at 8:58 AM, Igor Trevisan <igt1972@gmail.com> wrote:
Yes, this is a common need and there are several ways to solve it.

You can encode the Lua file as a C string and load that; this string
can then be compiled as part of your program.  (The Lua compiler is so
fast that generally compiling-as-bytecode is only needed for the most
performance-sensitive applications and/or embedded)

(Writing a Lua file as a C string is a straightforward exercise in Lua)

The Lua file can be attached to your executable, say as a resource (if
Windows) or simply glued to the end of the executable (which is how
srlua works)

If there are multiple files, they can be collected together as a code
archive (see Squish, soar, and others)
 
The problem is that I don't want to collect the lua files but
keep them detached.
I added an example answering to Thomas Jericke (later in the thread)
and I hope it can claearify things a bit...
I.
 
 
--
"Don't find fault, find a remedy" (H.Ford)
-------------------------------------------------------------------------
"Beer is proof that God loves us and wants us
to be happy" (Benjamin Franklin)
-------------------------------------------------------------------------