Re: Issues with the current varargs implementation (Was: Re: inadequate documentation for select and table.unpack)
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Issues with the current varargs implementation (Was: Re: inadequate documentation for select and table.unpack)
- From: Dirk Laurie <dirk.laurie@...>
- Date: 2016年6月23日 07:58:26 +0200
2016年06月22日 17:55 GMT+02:00 Eduardo Ochs <eduardoochs@gmail.com>:
> pack = table.pack or function (...) return {n=select("#", ...), ...} end
>
> Some people feel that using an "n" field in a table is something that
> has to be avoided at all costs.
> With time I learned to find that fascinating. =)
The annotated list is my favourite Lua structure, e.g.
{shape={2,3},1,2,3,4,5,6} for a matrix. It's almost
XML-like except that attribute sequence must not
matter (and anyway I have yet to see a real-world
docspec in which it does).