Re: Access to parameterized type

  • From: Justin Cormack <justin@xxxxxxxxxxxxxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Sun, 2 Sep 2012 22:23:47 +0100

On Sun, Sep 2, 2012 at 9:24 PM, Peter Colberg <peter@xxxxxxxxxxx> wrote:
> It would be great if LuaJIT had some optimisation to defer non-string
> key lookups to the __index method immediately, without consulting the
> hash part of the table. But maybe this is too specific.

I guess a __stringindex metamethod could do that.

I do tend to use that pattern a bit (making ffi arrays look like Lua
arrays etc).

Justin

Other related posts: