[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: From Lua to Python?
- From: Dibyendu Majumdar <mobile@...>
- Date: Thu, 13 Jul 2017 15:49:43 +0100
On 13 July 2017 at 15:06, Enrico Colombini <erix@erix.it> wrote:
> On 13-Jul-17 15:48, Dibyendu Majumdar wrote:
>>
>> I find that even with Lua, when I am exposing an API - I need to make
>> it OO for the user else user has to manage state and call functions
>> with potentially large number of arguments which just doesn't make
>> sense.
>
>
> You can easily do encapsulation in Lua, for example using modules as
> 'objects' with private functions/data and a public API. Of course
> polymorphism is there by default.
>
I find that it is better to ensure the OO syntax - i.e.:
object:method()
As this gives an immediate check on valid operations for each object /
class type.
Sure this is easy enough to do in Lua - and I do it all the time. But
for many people an explicit class definition syntax appears to be
attractive - I am not one of those people, but that is what I see.
Regards
Dibyendu
- References:
- Re: From Lua to Python?, Dibyendu Majumdar
- Re: From Lua to Python?, Dibyendu Majumdar
- Re: From Lua to Python?, Dirk Laurie
- Re: From Lua to Python?, Dibyendu Majumdar
- Re: From Lua to Python?, Javier Guerra Giraldez
- Re: From Lua to Python?, Dibyendu Majumdar
- Re: From Lua to Python?, Enrico Colombini
- Re: From Lua to Python?, steve donovan
- Re: From Lua to Python?, Javier Guerra Giraldez
- Re: From Lua to Python?, steve donovan
- Re: From Lua to Python?, Dibyendu Majumdar
- Re: From Lua to Python?, Enrico Colombini