[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Multiple indexing (was: 'in' keyword today)
- From: Dirk Laurie <dirk.laurie@...>
- Date: Thu, 10 Apr 2014 10:04:29 +0200
2014-04-10 9:45 GMT+02:00 steve donovan <steve.j.donovan@gmail.com>:
> On Thu, Apr 10, 2014 at 8:41 AM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
>> Suppose that the notation tbl[i,j,k] meant tbl[i],tbl[j],tbl[k], not
>> as a syntactic sugar, but as genuine multiple indexing overridable
>> by metamethods.
>
> What about defining 'unpackt' so that 'unpackt(tbl,i,j,k)' achieves
> the same result?
I actually have a whole library of `tuple` methods, which I find
I almost never use, but the name `unpackt` never occurred to me.
> Granted, it could never be as fast as a hard-baked language feature,
> but is fairly explicit and can of course be made to respect suitable
> 'synthetic' metamethods of tbl.
I'll retreat into Lua-the-whole Lua-and-nothing-but-Lua mode again, once
5.3 gets out of work, alpha and beta. For the moment, we're all mixing
dough for the fancy biscuits.