When a is set to nil, table will be still accessible to b. No separate memory is allocated separately for b. When we have a table a with set of elements and if we assign it to b, both a and b refer to the same memory. lua garbage collection will take care of releasing memory It is to be known that there is no fixed relationship between a variable that holds reference of table and the table itself. Lua uses a constructor expression to create an empty table. Tables are called objects and they are neither values nor variables. When we access a method string.format, it means, we are accessing the format function available in the string package. Lua uses tables in all representations including representation of packages. Tables have no fixed size and can grow based on our need. Lua uses associative arrays and which can be indexed with not only numbers but also with strings except nil. Tables are the only data structure available in Lua that helps us create different types like arrays and dictionaries.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |