lua-users home
lua-l archive

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


> -- 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.