Note that you'll need to keep the original k value around for the t[k] lookup and rawget(t, k) :) On 7 March 2014 12:00, Tom Yaxley <tommitytom@xxxxxxxxx> wrote: > Take a look at this: > https://github.com/luapower/winapi/blob/master/winapi/gl.lua > > You could prepend "gl" to k in __index before the call to checksym() to > achieve what you're after > > > On 7 March 2014 08:34, Victor Bombi <sonoro@xxxxxxxxxxxxxx> wrote: > >> Hello, >> >> There is some ffi opengl binding I would like to convert >> gl = ffi.load("opengl32") >> gives for example gl.glBegin as a function and I would like to get >> gl.Begin for the same function to make it compatible with luagl >> My plan was to use pairs over gl adding a new key without initial gl for >> each old key >> but gl is a userdata so I cant use pairs. >> >> Is there anything that could be done >> >> Best >> victor bombi >> >> >