![]() ![]() It is managed by Lua and can be garbage collected. The important one here for our purposes is userdata.Īn item of type userdata is a block of memory created by the host system in a language other than Lua, such as the Roblox engine. Technically, Lua also makes a distinction between Lua functions and C functions, but the implementation in Roblox seems to ignore this. They are nil, number, string, function, table, and userdata. Lua does have types, even though they are not declared or annotated. To understand the decision making behind the metatable system, we need to look at how Lua handles types. The official documentation also doesn’t give the greatest overview of metatables either, or at least they don’t come together until the C API section of the PIL. This is partly due to the way Lua is intended to be used in combination with another compiled language you don’t have access to this half of the picture as a Roblox developer. If you’re familiar with object oriented paradigms in other languages, you may have noticed that the way Lua does OOP makes no sense. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |