lua-users home
lua-l archive

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


2014-08-24 22:02 GMT+02:00 Thijs Schreijer <thijs@thijsschreijer.nl>:

> As "lua_State" not actually refers to a state, but to a thread or an
> execution, could it be renamed? To something that properly reflects
> what it is?
>
> I suspect that the name was introduced before coroutines were added,
> which meant that a state and a thread were pretty much the same thing
> then.

Your suspicion is correct. lua_State was introduced in Lua 3.1, the
API routines took *L as a parameter as from Lua 4.0, coroutines were
introduced in Lua 5.0.

But the world is full of things with names that reflect history rather
than modern insight. The "English horn" is not a horn. "Bombay duck"
is not a duck, etc.

And one is also used to various kinds of states: the state of the
nation, the nation state, a state of anxiety.

Frankly, if the most important thing that might be changed in Lua
is the word used for the structure created by lua_newstate (yes,
the repercussions of changing lua_State are considerable), there
is nothing rotten in the state of Lua.