lua-users home
lua-l archive

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


Thanks. I was not thinking.

On 10/12/05, Rici Lake <lua@ricilake.net> wrote:
>
> On 11-Oct-05, at 5:20 PM, David Burgess wrote:
>
> > In lua 5.1,  while we are looking at lua.c and args
> >
> > I think the creation of the "arg" variable should be guarded with
> >
> > #ifdef LUA_COMPAT_VARARG
>
> The arg variable gives you access to more things than ... does; for
> example, you can extract the script name with arg[0]
>
> $ cat argtest.lua
> for k, v in pairs(arg) do print(k, v) end
>
> $ lua51 argtest.lua a b c
> 1       a
> 2       b
> 3       c
> 0       argtest.lua
> -1      lua51
>
>