lua-users home
lua-l archive

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



On Sun, May 7, 2017 at 05:26 Dirk Laurie <dirk.laurie@gmail.com> wrote:
2017-05-06 23:02 GMT+02:00 Andrew Starks <andrew@starksfam.org>:
>
> On Sat, May 6, 2017 at 15:16 Dirk Laurie <dirk.laurie@gmail.com> wrote:
>>
>> 2017-05-06 17:50 GMT+02:00 Andrew Starks <andrew@starksfam.org>:
>> >
>> > On Sat, May 6, 2017 at 01:18 Dirk Laurie <dirk.laurie@gmail.com> wrote:
>> >>
>> >> 2017-05-05 23:27 GMT+02:00 Andrew Starks <andrew@starksfam.org>:
>> >>
>> >> > 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.

I think that you are very precise but way above the head of the
intended readership. Lua states are API only, and 'parent' is
a word not used in the Manual.

There's a new push on the website, with a new look courtesy of Jay Carlson.

-- Dirk

Good point and I like the changes. It's an advanced topic and if the goal is to teach a newcomer about it, a blog post with tutorial is a better avenue. 

-- Andrew