lua-users home
lua-l archive

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


On Tue, Dec 23, 2014 at 3:03 PM, Soni L. <fakedme@gmail.com> wrote:
> How can I tweak string.gsub so it's yieldable?
>
> More specifically I want my tweaked Lua to support this:
>
> c = coroutine.create(function() return string.gsub("test", ".",
> coroutine.yield) end)
> for i = 1, 4 do
> print(coroutine.resume(c))
> end

What's wrong with string.gmatch?

-- 
Patrick Donnelly