lua-users home
lua-l archive

Re: Say No to global-by-default (summary of the discussion)

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


Am 31.07.2018 um 11:00 schrieb Dirk Laurie:
[
<doublef.mobile@gmail.com>:
Dirk,
The only [1] place in Lua where syntax sugar saves you one statement is
How about
a():b()
vs
local dummy=a();dummy.b(dummy) ?
Thanks. I forgot about that one. But it is not quite equivalent;
(object_valued_expression):method(...) saves you a named local but
then you don't have that named local.

In the case you don't need that local variable, isn't that an advantage?
--
Thomas


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