lua-users home
lua-l archive

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

We would like to add Mike Pall's extension on gsub (to work with tables)
still in 5.1. However, to avoid inconsistencies, it would be better
if function-call and table-lookup results were interpreted the same
way.  That means to change the meaning of functions returning nil (or
nothing) from "the replacement string is the empty string" to "makes no

I don't think many programs have functions returning nil when they
want an empty replacement string, but anyway that would be a small
incompatibility from 5.1 alpha to beta (and final).

(Also, it seems more consistent if results different from nil/false
and string/numbers raise errors, instead of being ignored like
they are now. Again, I don't think many programs have gsubs with
functions returning weird values, but again that would be a small

-- Roberto