Jump to content

MetaTables


Karoffe

Recommended Posts

Sets the metatable for the given table. (You cannot change the metatable of other types from Lua, only from C.) If metatable is nil, removes the metatable of the given table. If the original metatable has a "__metatable" field, raises an error.

This function returns table.

What's the use of this table ? and what's the difference between it and a normal table ?

How can I use it ?

Link to comment

Metatables give usual tables "special abilities" (Thanks to ixjf for the correcting me) (symlink to another table, lock itself, make some tasks simpler, create sandboxes). There is a dx library in default race resource, you can see how you can code OOP with metatables.

Edited by Guest
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...