lua-users home
lua-l archive

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


* On 2014-03-26 13:29:39 +0100, Luiz Henrique de Figueiredo wrote:
 
> > -- main.lua
> > require("x")
> > require("y")
> 
> Like I said in stackoverflow, these two invocations are not equivalent:
> 
> 1. lua main.lua 
>    This runs x, y, main exactly once each in this order.
> 
> 2. lua main.out after luac -o main.out -s x.lua y.lua main.lua
>    This runs x, y, x, y, main, in this order.
>    So x and y and run twice.
> 
> The problem is that luac does not understand require.
>     luac -o main.out -s x.lua y.lua main.lua
>
> generates code that runs x, y, main in that order. When main is run,
> it runs x and y again.

Note that the original mail stated:

"[...] but when i delete all requires from main.lua and use commands for
compiling: [...]"

-- 
:wq
^X^Cy^K^X^C^C^C^C