Re: what to make of this fellow named __ipairs?
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: what to make of this fellow named __ipairs?
- From: Dirk Laurie <dpl@...>
- Date: 2011年1月27日 09:58:41 +0200
On Thu, Jan 27, 2011 at 08:42:32AM +0200, David Manura wrote:
>
> The Reference Manual specifies the mechanics of `__ipairs` [1] but not
> its intended purpose.
I use it exclusively as a hack that allows `for` loops to work with
proxy tables too. Thus:
__pairs = function(t) return pairs(t[index]) end;
__ipairs = function(t) return ipairs(t[index]) end;
Dirk