[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [proposal] Libary changes
- From: Sebastien Lai <237482@...>
- Date: Tue, 11 Oct 2011 09:42:28 +0200
On Tue, Oct 11, 2011 at 7:22 AM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> I'm trying to guess what you mean by "overwritten inside the loop".
I don't know why you have to "guess" something as obvious as this, but
have at it.
stuff = {"red", "green", "blue"}
for _, arg in pairs(stuff) do
-- arg is no longer the "commandline argument vector" here.
-- anyone who has mastered the Lua tutorial should know that.
print("stuff:", arg)
end
-- but since 'arg' is local to the for loop, it is only overwritten
__inside__ the for loop.
for _, s in pairs(arg) do print("arg:", s) end
- References:
- [proposal] Libary changes, Sebastien Lai
- Re: [proposal] Libary changes, Sam Roberts
- Re: [proposal] Libary changes, Sebastien Lai
- Re: [proposal] Libary changes, Petite Abeille
- Re: [proposal] Libary changes, Sebastien Lai
- Re: [proposal] Libary changes, Dirk Laurie
- Re: [proposal] Libary changes, Sebastien Lai
- Re: [proposal] Libary changes, Dirk Laurie
- Re: [proposal] Libary changes, Sebastien Lai
- Re: [proposal] Libary changes, Dirk Laurie