This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
augustas656's profile picture

Meta API - Easy meta-table handling

Started by augustas656, 10 March 2016 - 03:55 PM
augustas656 #1
Posted 10 March 2016 - 04:55 PM
The meta application programming interface allows easier manipulation of meta-tables. Currently, the interface introduces a function to modify the meta-table of any table by appending new meta-keys with new meta-values and optionally overriding old meta-keys with new meta-values. Additionally, the interface introduces a function to modify the index meta-method to allow indexing from multiple other tables and an auxiliary function to shorten the code necessary to set the call meta-method for any table.

Pastebin link:
http://pastebin.com/7r9p39hQ
Pastebin get:

pastebin get 7r9p39hQ meta
Loading:

os.loadAPI("meta"); -- or whatever name you assigned the interface

I cannot guarantee that this interface functions correctly so I would greatly appreciate any criticism and bug reports.

Changelog:
  • Tidied code
  • Fixed localization
  • Dumped lots of semi-colons
Legacy:Kind Regards,
augustas656
Edited on 11 March 2016 - 06:15 PM
LeDark Lua #2
Posted 10 March 2016 - 05:34 PM
//Offtopic: Geras, dar vienas Lietuvis, sveikas.

Pretty good, might use it sometime or another.