[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Re: Functions as first-class objects
- From: Dirk Laurie <dirk.laurie@...>
- Date: Sun, 2 Sep 2018 14:54:36 +0200
Op So., 2 Sep. 2018 om 13:19 het Egor Skriptunoff
<egor.skriptunoff@gmail.com> geskryf:
>
> On Sun, Sep 2, 2018 at 9:28 AM, Dirk Laurie wrote:
>>
>> Op So., 2 Sep. 2018 om 01:41 het Alejandro Reimondo geskryf:
>>
>> > In object paradigm (Object Technology) the only way to
>> > interact with an object is sending messages.
>>
>> The Lua way to send messages to a running function is the yield-resume
>> mechanism for coroutines.
>
>
> I guess Alejandro is just using Smalltalk-like terminology.
> "Send a message to an object" in Smalltalk is equivalent to
> "invoke an object's method" in usual OOP.
Thank you for explaining what you think the OP meant. In that case, my
reply (#4 in this thread), also given later by
ks_isaf@126.com, would have been adequate.
Since the OP seemed to be less experienced in Lua than the galaxy of
grandmasters posturing on this list, I assumed that a little
explanation of coroutines was in order.
Of all Lua's features, the coroutine library took me longest to
understand. I enjoyed writing in simplest possible terms about them,
and found thinking about "extra arguments passed to coroutine.resume"
as messages helpful.