[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: metatables for strings?
- From: "书呆彭, Peng Yi" <nerditation@...>
- Date: Thu, 7 May 2015 13:36:26 +0800
在 2015/5/7 4:04, tonyp@acm.org 写道:
What about table constructors as in `return {init = function(self, ...)
return self end}:init()`?
well, since Lua has similar sugars for function calls with a single parameter
of string and of table constructor, it would lead to a similar grammer ambiguity
as to the string case:
this code
a = b { some = 'table constructor' } : method()
could either be interpreted as
a = b; { some = 'table constructor' } : method()
or
a = b{ some = 'table constructor' } : method()
--
the nerdy Peng / 书呆彭 / Sent from Thunderbird
- References:
- metatables for strings?, Sam Putman
- Re: metatables for strings?, Nagaev Boris
- Re: metatables for strings?, Sam Putman
- Re: metatables for strings?, Sam Putman
- Re: metatables for strings?, Dirk Laurie
- Re: metatables for strings?, Nagaev Boris
- Re: metatables for strings?, Sam Putman
- Re: metatables for strings?, Nagaev Boris
- Re: metatables for strings?, Dirk Laurie
- Re: metatables for strings?, Hisham
- Re: metatables for strings?, Luiz Henrique de Figueiredo
- Re: metatables for strings?, Hisham
- Re: metatables for strings?, Soni L.
- Re: metatables for strings?, tonyp