In Python, we can use @property decorator to use the method as property.
>>> Class A:
>>> @property
>>> def b(self):
>>> return 1
>>> a = A()
>>> a.b
1
Is there any way to do this in Lua? Are there any examples of that?
In Python, we can use @property decorator to use the method as property.
>>> Class A:
>>> @property
>>> def b(self):
>>> return 1
>>> a = A()
>>> a.b
1
Is there any way to do this in Lua? Are there any examples of that?