[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Local Variables
- From: Mason Mackaman <masondeanm@...>
- Date: Thu, 7 Aug 2014 11:56:59 -0500
So recently I found out that local variables are always faster. So I have two questions, when would you ever need a global variable, and why would Lua make all variables global by default if you use local way more often? It seems to me that I could just declare a variable local right off the bat so it has the same scope as if it were global (I feel like there has to be a difference in scope that I just don’t know about).