lua-users home
lua-l archive

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

Arseny Vakhrushev wrote:
> Is pcall() in LuaJIT yieldable or am I missing something?

>  $ luajit-2.0.0-beta8 -e 'assert(pcall(function () coroutine.yield() end))'
> luajit-2.0.0-beta8: (command line):1: (command line):1: attempt to yield across C-call boundary
> stack traceback:
>         [C]: in function 'assert'
>         (command line):1: in main chunk
>         [C]: ?
> ... don't work of course, but it seems that the C-call boundary here isn't 'pcall' itself but the main call of the '-e' chunk.

Sure. And there's no coroutine, of course. The error message is
kept for compatibility.