[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: table library changes (was Re: table.new in 5.3?)
- From: steve donovan <steve.j.donovan@...>
- Date: Mon, 25 Nov 2013 12:32:36 +0200
On Mon, Nov 25, 2013 at 12:19 PM, John Hind <john.hind@zen.co.uk> wrote:
> Having the existing single element table.remove and table.insert encourages users to write [inefficient] code like:
Well, no language is safe from inexperienced users. It's only really
a problem if the resulting program is too slow for its purpose.
> t = {}
> for i=1, 10000 do t[i] = i end
> for i=11, 9899 do t[i] = t[91+i] end
> for i=10000, 9900, -1 do t[i] = nil end
What is the magic number 91 doing here? I'm curious....
steve d.