The command-line –l option help says: -l name require library 'name'
I assumed this to be equivalent to starting a script with: require ‘name’
Now, if I have a library file named xxx.lua which also includes a function named xxx,
using the –l method vs the explicit require method does not behave the same.
File xxx.lua contains just this: function xxx() print 'hello' end
And, here’s the output I get for each case:
c:\temp>lua -l xxx -e "xxx()
lua: (command line):1: attempt to call a boolean value (global 'xxx')
(command line):1: in main chunk
[C]: in ?
c:\temp>lua -e "require 'xxx' xxx()
Is this expected behavior, or bug? If expected, then perhaps the help message is a bit misleading.