Jump to content




API with metatable


2 replies to this topic

#1 Sebra

  • Members
  • 726 posts

Posted 27 February 2016 - 08:43 AM

While Dan200 in the process of changing and we all can test new beta I want to ask for a way to add metatable to loaded API.
Any way would be good. Even that simple way in spoiler. It allows API to return it's table directly but not forces to change any existing API.

Spoiler

Dan200, please answer.
Is API metatable not wanted for any reason?
Is my example bad?
Would you add any other way for it?

#2 Creator

    Mad Dash Victor

  • Members
  • 2,168 posts
  • LocationYou will never find me, muhahahahahaha

Posted 27 February 2016 - 10:23 AM

Just use setmetatable:

setmetatable(API,table) --don't actually call it table baecause it will cause issues.

Metatables are not bad ina any way.

Why do you think someone is against them?

Edited by Creator, 27 February 2016 - 10:26 AM.


#3 Sebra

  • Members
  • 726 posts

Posted 27 February 2016 - 12:19 PM

Current way of loading API copies API content to new table after API loaded. So there is no way for API to add metatable to own table.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users