|
On Aug 10, 2013, at 12:31 AM, Tim Hill <drtimhill@gmail.com> wrote:
On Aug 9, 2013, at 11:58 PM, Hao Wu <wuhao.wise@gmail.com> wrote:
So my question is, when dealing with string literal, why couldn't we just say:
"a string literal":lower()
instead
("a string literal"):lower()
Is there a language reason to prevent this?
Thanks,
~hao
What's more interesting is that, by my reading of the BNF, _neither_ of these should work (though the second, as you state, does work). SO far as I can see, the BNF doesn't describe the full colon syntax (it is only mentioned when used as part of a function declaration).
--TimIgnore that .. my brain shut down there for a moment. Here is the Lua BNF that is significant:prefixexp ::= var | functioncall | ‘(’ exp ‘)’ functioncall ::= prefixexp args | prefixexp ‘:’ Name args
So yes, you do need parens.
--Tim