Like asked in the title, lets say I want to add a custom method to the table
type, lets say table:printContent()
, is there any way in Lua to achieve this? I mean only, pure, Lua. In C#, for example, you can use extensions to do that:
using System;
namespace Main {
public static class Extension {
public static void printContent(this table mytable) {
foreach(var content in mytable) {
Console.WriteLine(content.ToString());
}
}
}
}
Now is the same possible, only in Lua?
The question I inspired me from (that question didn‘t tought me what I wanted to learn, and yes I want OOP, if I want to mod for example in Lua)