[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Alternative (better?) __index implementation
- From: Mark Hamburg <mhamburg@...>
- Date: Tue, 11 Dec 2007 14:11:16 -0800
on 12/11/07 9:55 AM, Roberto Ierusalimschy at firstname.lastname@example.org wrote:
>> I've wanted a way to do this in Lightroom's class system. We optimize for
>> the case where a class has no getters or setters, but most of the classes
>> have them. The solution I'd been considering was to add an extra parameter
>> to the index function giving the base table. I like Rici's solution,
> Do you like or do you prefer Rici's solution? (If you prefer, why?)
I'm not sure which I prefer. I would probably want to write some code
against each approach.
Extending the __index function avoids the legacy issue with Rici's approach
of whether to support __index tables. On the other hand, it fairly
specifically works for a one stage cache and potentially little else since
you don't get any intermediate tables on the __index chain.