lua-users home
lua-l archive

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

Ben <> wrote:

> My only suggestion:  in the "Pattern Matching" section, the last
> entry, `string.gsub("Lua is great!", "^.-a", function (s) return
> string.upper(s) end)` is much more simply put as `string.gsub("Lua is
> great!", "^.-a", string.upper)`.

You're of course right. However, I think that the explicit "function ...
end" makes clearer (at least to a casual reader) the point that one can
use functions as a parameter there.

cheers  thomasl