lua-users home
lua-l archive

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


Nick Gammon wrote:
Probably the manual should be reworded as:
"gsub also returns, as its second value, the total number of matches made."

But this would be, in fact, an API alteration, and API is not allowed to change after the Lua version is officially out.

No, that is a clarification of what it currently does. It currently returns the number of times it matched, regardless of what happens when it matches.

Thus, if the API is not allowed to change, the manual rewording is what is required.

API *is* the manual. The manual (not the source code!) is the only definitive authority with regards to the API. What you suggest is not rewording, it is *change*, since number of matches and number of substitutions are totally different things.

--
Shmuel