lua-users home
lua-l archive

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

On Sat, May 6, 2017 at 15:16 Dirk Laurie <> wrote:
2017-05-06 17:50 GMT+02:00 Andrew Starks <>:
> On Sat, May 6, 2017 at 01:18 Dirk Laurie <> wrote:
>> 2017-05-05 23:27 GMT+02:00 Andrew Starks <>:
>> > I think that the Luaverse will be much better off if
>> > you tackle `coroutine` and `thread`.
>> OK, the most recent push has them.
> Thank you! I read them. Why are coroutines too complicated to explain?
> What is the hard definition of a coroutine in Lua?

I can't remeber anymore, All I can remember is that when I was a newbie,
metamethods, coroutines and the generic 'for' were the things that
threw me. (I never had any problem with #tbl).

As a newbie, I'd like something to explain a concept to me to the degree that if it's being discussed in a sentence, I know conceptually what author is referring to. Therefore, I think that:

thread: A Lua state, which may be initialized, executing, paused,  and done (with or without error). 

coroutine: a thread that has a parent.

> Also, I think that you can leave off the "this topic is to complicated"
> comment. If it's wanting for further definition, then it should be further
> defined as part of some later update. If not, then what is there doesn't
> need and isn't helped by the disclaimer. Imho.

I like this suggestion.

-- Dirk