lua-users home
lua-l archive

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


> On Jun 11, 2015, at 5:26 AM, Rodrigo Azevedo <rodrigoams@gmail.com> wrote:
> 
> REASONING
> 
> There are uncountable examples of "methods" that do not need an argument, for example
> 
> led[1]:blink
> arm[2].pos[3]:go
> z:abs
> z:Re
> polynomial:diff
> etc
> 
> PROPOSAL
> 
> Raise the "methods" syntactic sugar ":" to a function call without arguments, with the exception of the ubiquitous "self", namely, call "methods" without the common usage of  '(' ')', or '{' '}' or ' " ' ' " '. 
> 

But what does this really give you? You can type “x:foo” instead of “x:foo()”. This doesn’t seem like much of a pay-back for making the language harder to read. At the moment it’s pretty clear when a function/method is called. All this patch does is make that more obscure so that you can save a tiny bit of typing.

—Tim