[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: 'table' as fallback for tables
- From: Jay Carlson <nop@...>
- Date: Tue, 28 Jun 2016 11:53:27 -0400
On Jun 28, 2016 2:47 AM, "steve donovan" <steve.j.donovan@gmail.com> wrote:
>
> On Tue, Jun 28, 2016 at 8:41 AM, Daurnimator <quae@daurnimator.com> wrote:
> > Which really doesn't need any changes to lua itself anyway; just a
> > vague agreement on 'one' standard sequence/array/list library.
>
> +1, simple and sweet. 'n' is hidden as it should be.
>
I haven't been following this thread that closely. So I apologize if this has already come up.
Speaking of hidden, it's a big deal whether 'n' is exposed to pairs().
If it is, special work has to be done in exploded-LOM-like keyed lists like
{key="datapoints", 7, 3, nil, 7, n=4}
When you iterate over the non-numeric keys, you also need to skip t.n. And...
If you don't include it in pairs, then
function shallowclone(t)
local nt={}
for k,v in pairs(t) do
nt[k] = v
end
return nt
end
is not going to clone all tables.
Jay
- References:
- 'table' as fallback for tables, Dirk Laurie
- Re: 'table' as fallback for tables, Philipp Janda
- Re: 'table' as fallback for tables, Roberto Ierusalimschy
- Re: 'table' as fallback for tables, Philipp Janda
- Re: 'table' as fallback for tables, Tim Hill
- Re: 'table' as fallback for tables, Philipp Janda
- Re: 'table' as fallback for tables, Roberto Ierusalimschy
- Re: 'table' as fallback for tables, Philipp Janda
- Re: 'table' as fallback for tables, Coda Highland
- Re: 'table' as fallback for tables, Jay
- Re: 'table' as fallback for tables, Tim Hill
- Re: 'table' as fallback for tables, Dirk Laurie
- Re: 'table' as fallback for tables, steve donovan
- Re: 'table' as fallback for tables, Daurnimator
- Re: 'table' as fallback for tables, steve donovan