[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: A question about "yieldables"
- From: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 23 Feb 2015 09:41:39 -0300
> 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?
> (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.)