[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Error Text Suggestion for coroutine.status in 5.3
- From: Tim Hill <drtimhill@...>
- Date: Fri, 29 Aug 2014 07:52:22 -0700
On Aug 29, 2014, at 1:21 AM, Thijs Schreijer <thijs@thijsschreijer.nl> wrote:
>>
>> 2014-08-29 9:23 GMT+02:00 Coroutines <coroutines@gmail.com>:
>>> On Fri, Aug 29, 2014 at 12:19 AM, Dirk Laurie <dirk.laurie@gmail.com>
>> wrote:
>>>
>>>> And I would like to see "bike shed" replaced by "velocipede depot" :-)
>>>
>>> I wonder if the bike shed argument has ever been used on this list to
>>> a productive end -- instead of being dismissive and a waste of my mail
>>> quota.
>>
>> Maybe I should have reminded readers that a proposal to change
>> lua_State to lua_Thread or whatever is also on the table.
>>
>> If we go along this road, then the "table" library should become
>> the "sequence" library,
>>
>> There should be one and only one reason ever to change a name:
>> because the new name is used for something different.
>
> Not necessarily. The examples shown (coroutine/thread and lua_State) are pure legacy, if not now, then sometime in the future you'll have to clean that up, simply because over time you'll be accumulating more and more. And even then backward compatibility is only one #define away (for the c api at least)
>
> Thijs
“For historical reasons, a Lua_State represents the current state of a Lua thread (not an operating system thread), including its stack. A state created using lua_newstate() is always the main thread of a new, independent global environment (with it’s own registry etc), while any states created with lua_newthread() are coroutines and share the global environment with the main thread.” (Not quoting, just suggesting how this could be explained.)
Seems clear enough to me. Why break all existing C code just to rename something? And in fact the existing convention works well for the vast majority of cases where the C code never directly has to create anything other than the main thread.
—Tim