Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local object, id = require("object")
- local Plan = {}
- function Plan:__construct(lua)
- self.lua = lua
- print(("[%s:Plan:construct()]: lua is: %s"):format(id(self), self.lua))
- end
- function Plan:__tostring()
- return ("[%s:Plan:__tostring()]"):format(id(self))
- end
- function Plan:method()
- return ("[%s:Plan:method()]: lua is %s"):format(id(self), self.lua)
- end
- print(("id(Plan): %s"):format(id(Plan)))
- print()
- local plan1 = object(Plan, "fucking weird.")
- plan1.lua = 'weird'
- print(([[plan1:
- id(plan1): %s
- tostring(plan1): %s
- plan1:method(): %s
- ]]):format(id(plan1), tostring(plan1), plan1:method()))
- local plan2 = object(Plan)
- plan2.lua = 'weirder'
- print(([[plan2:
- id(plan2): %s
- tostring(plan2): %s
- plan2:method(): %s
- ]]):format(id(plan2), tostring(plan2), plan2:method()))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement