lua-users home
lua-l archive

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


On Fri, Jun 3, 2011 at 06:47, steve donovan <steve.j.donovan@gmail.com> wrote:
> On Fri, Jun 3, 2011 at 12:25 PM, Dirk Laurie <dpl@sun.ac.za> wrote:
>> Which is better?
>
> I would say: avoid the local 'arg' like the plague, it's a Lua 5.0 -ism ;)
>

I aways wondered how to get arg[0] (name of the current script) with {...}?

The following script show the difference

-- test.lua (Lua-5.1)
print("arg[0]", '=',  arg[0])
print("({...})[0]", '=', ({...})[0])
----
Output:
  arg[0]  =       test.lua
  ({...})[0]      =       nil

--Leo--