lua-users home
lua-l archive

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


And, apparently, Lua v5.1 does it correctly.  Lua 5.2 and 5.3 do it wrong.
 
Sent: Sunday, February 26, 2017 12:41 AM
Subject: Re: command-line -l option issue
 
More on this.  I think the function name being the same as the library filename is the problem.  Because if I change xxx() to zzz(), no problem.
 
Let xxx.lua contain this:
 
function xxx() print 'hello' end
function zzz() print 'hello' end
 
then:
 
c:\temp>lua -l xxx -e xxx()
lua: (command line):1: attempt to call a boolean value (global 'xxx')
stack traceback:
        (command line):1: in main chunk
        [C]: in ?
 
c:\temp>lua -l xxx -e zzz()
hello
 
which indicates –l is processed before –e but something else is causing this.
 
Sent: Sunday, February 26, 2017 12:31 AM
Subject: Re: command-line -l option issue
 
But in that case, shouldn't it be that xxx is nil rather than boolean?
 
c:\temp>lua -l xxx -e "xxx()
lua: (command line):1: attempt to call a boolean value (global 'xxx')
 
as in:
 
c:\temp>lua -e "xxx()
lua: (command line):1: attempt to call a nil value (global 'xxx')
 
 
-----Original Message-----
From: Vadim A. Misbakh-Soloviov
Sent: Saturday, February 25, 2017 11:17 PM
To: Lua mailing list
Subject: Re: command-line -l option issue
 
It is not a bug. Just `-l` executes after `-e`. That's all. It is same for
all
Lua versions including LuaJIT.