[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Too many local variables?
- From: "Andreas Falkenhahn" <andreas@...>
- Date: Thu, 09 Jun 2011 17:57:21 +0200
when I use a script such as:
local a, b = 1,2
and repeat the line "local a, b = 1,2" over 100 times in the function, I get the following error:
input:102: function at line 1 has more than 200 local variables
I'm wondering whether this is intended behaviour because actually, I'm only using
two variables named 'a' and 'b'. They are all placed in the same scope so I don't
quite understand why Lua creates 200 variables from these two. Because the initializations
occur always in the same scope, Lua wouldn't have to store 200 variables on the
stack but it could simply work with two. Any explanations for this behaviour?