[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: High-level vs low-level overrides / Multi-level overrides
- From: Duane Leslie <parakleta@...>
- Date: Tue, 2 Aug 2016 22:57:03 +1000
>> `pairs` is actually building me a custom iterator closure which
>> it returns as its first result.
>
> It may feel like that but in fact `pairs` simply returns `next,tbl,nil.`
I wasn't clear, I meant that I feel the purpose of `__pairs` is that it allows me to build a custom iterator. I know that without a metamethod it just returns the `next` function. Using the `__pairs` metamethod I can create exactly the examples you give.