lua-users home
lua-l archive

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


All is now clear. 

Thanks.
R.



On Wed, Sep 10, 2014 at 12:04 PM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
2014-09-10 17:38 GMT+02:00 Robert McLay <mclay@tacc.utexas.edu>:
> Thanks all.  It is clear that this is safe to use.  At least until there is
> a good reason to remove support for it in later releases.
>
> I get that ("5",x,y) is going to return "5".  What I don't get is why then
> is:
>
>    s = '5':rep(4)
>
> does not work but
>
>    s = ('5'):rep(4)
>
> does.

prefixexp ::= var | functioncall | ‘(’ exp ‘)’

functioncall ::=  prefixexp args | prefixexp ‘:’ Name args

Since '5' is neither a variable nor a function call, it needs parentheses.




--
Robert McLay, Ph.D.
TACC
Manager, HPC Software Tools
(512) 232-8104