View Single Post
09-20-16, 04:13 AM   #18
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
Originally Posted by rhiorg View Post
Sounds kinda like caching. (I'm coming from the C#, server-side world mostly.)
That's actually an apt description of "local". Whatever follows is "cached" to your code's scope. Any object declared by "local" in your code, either a new one or one equal to a global one, is only usable by your code. A slight exception is a global table. When you declare a new object equal to a table, you are actually creating a reference to that table. Every time your code changes the object you made, the global table is changed as well, and vice versa (your local object sees changes to the global one). Other code still cannot use this local reference but can still manipulate the table it points to.
  Reply With Quote