lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Thu, Sep 11, 2008 at 12:44 PM, Rob Hoelz <> wrote:
> Hello everyone,
> I'm trying to write a multiple dispatch method system for Lua using my
> object system, of which the cornerstone is this:
> Using a tree-like memoization cache is fairly clear, but I have the
> feeling that there's a better way to do this.  Any hints/suggestions?

to use multiple inputs as key to the memoization table, you can either
nest tables (what you call tree-like), or join all inputs into a
single string and use that as key.

but, i don't really get your object implementation, and it seems you
want to use memoization to speed up method lookup.  if so, you should
really rethink your object infrastructure.  if lookup is so expensive,
it might be better to copy all inherited methods in the new class

of course, i find myself caring less and less about class-based OOP.
i especially don't find the inheritance concept worth in real life the
troubles it carries.