lua-users home
lua-l archive

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


2011/10/10 Sebastien Lai <237482@googlemail.com>:
> On Mon, Oct 10, 2011 at 5:18 PM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
>> [...]
> Yes. it is overwritten inside the loop.
You'll have to quote the actual code to make me believe that.  Look here:

~~~~ file foo.lua
for k=1,#arg do print(arg[k]) end
s={a=1,b=2,c=3}
for arg in pairs(s) do print(arg) end
for k=1,#arg do print(arg[k]) end
~~~~

$ lua foo.lua 10 20 30
10
20
30
a
c
b
10
20
30

> Ohohoh, you didn't just try to tell me to use Ruby, Perl or Python instead of Lua?
> Sorry, that's not going to happen (although I do like Perl and Python). :-)
>
Of all arguments to include something in Lua, the two that convince me
least are:
  1. There is no reason not to do it.
  2. It's done that way in Language X.

And the one that persuades me most to treat it seriously, is:
  I've made a careful study of the article "The Evolution of Lua" by
Roberto, Luiz and
Waldemar, and this suggestion is in line with how Lua has been evolving.

So, when you mentioned pack becoming table.pack, I took your
suggestion seriously.  But then you spoiled it with costume jewelry
and a fake snake.

Dirk