[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: what to make of this fellow named __ipairs?
- From: steve donovan <steve.j.donovan@...>
- Date: Thu, 27 Jan 2011 11:26:41 +0200
On Thu, Jan 27, 2011 at 10:20 AM, Axel Kittenberger <axkibe@gmail.com> wrote:
> For your 'objects' you can make ipairs mean whatever you want it to.
> Sticking with the default meaning (e.g. for proxy tables) should be
> prefered coding style since the reader/maintainer familiar with Lua
> will expect it to work that way.
Yes, both the beauty and the pain of dynamic languages comes from
interfaces being 'underspecified'.
There is a mechanism, then we have to choose policy.
__next meaning overriding the meaning of next()? It could go further
and modify pairs() behaviour as well, but that might have performance
implications (there's always that trade-off)
steve d.