[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Question about Lua/C API lua_error usage
- From: Sergey Kaplun <sergeykaplun1998@...>
- Date: Thu, 12 Aug 2021 17:05:28 +0300
On 12.08.21, Viacheslav Usov wrote:
> On Thu, Aug 12, 2021 at 2:46 PM Sergey Kaplun
> <email@example.com> wrote:
> > Yes, I know, but this part is ommitted in Lua 5.1 Reference Manual .
> > I just quote the most verbose one.
> That is not how this works. Lua 5.1 and Lua 5.4 are different
> languages, and whatever one manual says or does not say is not
> necessarily true about the other one.
> Unless the Lua 5.1 manual is updated, which I doubt, you will have an
> implementation-defined behavior. Since your real interest is in
> LuaJIT, I am afraid you will have to accept whatever Mike Pall thinks
> is right or wrong.
I have little faith in dogmatism. It is always better to hear more
points of view than one.
> For Lua 5.4, you should have a look at this sentence in the entry on
> lua_status(): "You can call functions only in threads with status
> LUA_OK". I suspect the status of the newly created thread pointed by
> next_cur_L would not be LUA_OK. And that would probably be the case in
> Lua 5.1, too.
> Another problem with your code is that it pops the new thread from the
> Lua stack; it is then usafe to do anything about it, yet this is
> exactly what your code does afterwards.
Yes, it is true that this coroutine isn't protected, I know about it.
Again, it is just silly example.
Got your point!
Thanks for your participating!
> > >
> > > Cheers,
> > > V.
> > : https://www.lua.org/manual/5.1/manual.html#3.6
> > --
> > Best regards,
> > Sergey Kaplun