lua-users home
lua-l archive

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



On 2015-10-08 19:25, Soni L. wrote:

> 
> 
> On 08/10/15 07:16 PM, Paul K wrote:
> >   > Soni said "adding spaces around the long strings just doesn't
> >   > look as good".
> >
> > Right ;). t[([[]])] should work for those disliking spaces. He
> > didn't say anything about disliking parentheses.
> >
> > Paul.
> >
> [([[ still doesn't look as good as [[[ because '(' is round while '['
> is square. ("you got a round thingy in the middle of the square
> thingies.")

t = setmetatable(t, {
  __call = function(_, i) return t[i] end
})

print(t[[look Ma', less round and square thingies]]


.. yes I know thats not sufficient for all cases, making something
like
 t[[newindex]] = blah
working is left for the reader.

	Christian