|
The first change is simple and I have already a patch for it, I can release it as single patch if someone is interested.
This change simply makes the function call brackets optional if there is no argument, other than self which is implicitly added.
This means you can write:
require "string"
local text = "I can shout!"
print(text:upper) --> I CAN SHOUT!
I think this change is quite useful for the following reasons:
- No ambiguity: The : operator outside a function declaration like "function table:funct() ... end" already defines a function call, no need to define it twice with empty brackets.
Anyway, with the first step already done I am now trying to handle the "hello":function and 1.6:function to work.
I am not sure how much I want to allow. Especially in this case:
print( lower "I'm getting loud with you !" : upper)
What should happen? Synstax error, print "I'M GETTING LOUD WITH YOU!", or "i'm getting loud with you!"?