[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Standalone lua, stdin, and arguments
- From: David Burgess <dburgess@...>
- Date: Wed, 12 Oct 2005 08:47:14 +1000
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
>
>
- References:
- Standalone lua, stdin, and arguments, David Given
- Re: Standalone lua, stdin, and arguments, David Burgess
- Re: Standalone lua, stdin, and arguments, David Burgess
- Re: Standalone lua, stdin, and arguments, Rici Lake