lua-users home
lua-l archive

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

> Lua 5.2 added the ability to yield thru C functions, but most
> functions aren't yieldable (e.g. string.gsub, load, table.sort).
> Does the manual require that those functions be non-yieldable? or
> could a conforming implementation have them be yieldable?

No. Yes.

> (Also why are they not yieldable in the reference implementation?)

It does not seem to be a good cost-benefit approach. Making them
yieldable will probably make them more complex and slower in the "normal"
case. ('load' has an extra difficulty that it would require changes in
the C API; table.sort has an extra difficulty that it is recursive;
string.gsub may be not that problematic, after all.)

-- Roberto