Hi, I’ve been working on this class creator based on Python for a few weeks and maybe planning to release it when the module is finalized, How’d you guys think of it?
local messageClass = class(nil, {
__index = "self",
__init = function(self, message: string)
self.message = message
end,
[def "printMessage"] = function(self)
print(self.message)
end,
[def "setMessage"] = function(self, message: string)
self.message = message
end,
})
local message = messageClass("Hello World!") -- or messageClass.new()
message.printMessage()
message.setMessage("Hello world again!")
message.printMessage()
I’d like to hear criticism, as long as it is constructive!