lua-users home
lua-l archive

Re: [ANN] Lua Short Reference, 2nd draft

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


Ben <thebassplayer@gmail.com> 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
web: http://thomaslauer.com/start

AltStyle によって変換されたページ (->オリジナル) /