lua-users home
lua-l archive

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



> -----Original Message-----
> From: lua-l-bounces@lists.lua.org [mailto:lua-l-bounces@lists.lua.org] On
> Behalf Of Andrew Starks
> Sent: vrijdag 29 augustus 2014 0:12
> To: Lua mailing list
> Subject: Error Text Suggestion for coroutine.status in 5.3
> 
> I have a minor suggestion to make, regarding the error returned from status:
> 
> if you pass status something that isn't a thread, it returns:
> 
> `bad argument #1 to 'status' (coroutine expected)`
> 
> 1: It would be more correct to say "thread", since that is the type. This is
> slightly confusing to a newbie, because type(value) == "thread" is what you
> would type to check for it and conceptually, a coroutine is a function with
> a yield inside of it (as PiL explains it).
> 2: Most other error returns tell you what it received, along with what it
> expected. That would be helpful here, too.
> 
> Thank you for considering these changes!
> 
> 
> -Andrew

Generally speaking I would like to see all "thread" stuff in Lua being replaced by "coroutine", including the c api. The inconsistencies are confusing. Especially for new comers that tend to think in preemptive OS threads whenever they see the word "thread".

Thijs

 - yes, is breaking, I break stuff all the time.