lua-users home
lua-l archive

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


> a) is it worth keeping the 5.0.2 gsub as gsub and putting the new
> behaviour into string.repl()

Those that want that can do it themselves:

local ogsub = string.gsub
string.gsub = function (a,b,c,d)
  if type(c) == "function" then
    local oc = c
    c = function (...) return oc(...) or '' end
  end
  return ogsub(a,b,c,d)
end
string.repl = ogsub


> b) is it worth a _COMPAT_ flag?

No need. Just use the compatibility code above.


> And finally a question for Roberto et al - are you committed to the
> 5.1b behaviour?

Well, we do not intend to change that.

-- Roberto