[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [Suggestion] Define t[[[]]] to index t with a long string
- From: Christian Thaeter <ct@...>
- Date: Fri, 9 Oct 2015 01:57:09 +0200
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