lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Really appreciate your intention to help and the explanation on coroutines.

thank you

Ale


El 02/09/2018 a las 9:54, Dirk Laurie escribió:
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.