lua-users home
lua-l archive

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

I have a strange problem :

'foo' is a userdata, the 'gettable' method in his metatable was set to a 
c function. When I do '' the gettable method return a c closure 
with upvalue.

The object is to call bar : '' and all method of foo use the 
same c function but with different upvalues.

But is there a difference between theses two lua codes :
"f =; v = f()" and "v ="
I've made test with theses two call and obtain different result and I 
don't understand why.

I suppose it's possible the bug was in the 'gettable' method, I use this 
code :

  lua_pushcclosure(L, lune_call, 2);
  return 1;

So it return a c function with two upvalue : my userdata and the 
function name, lune_call make the stuff.
But I'm not sure I can use these value on the stack for making upvalues.


Thomas Lavergne                       "Le vrai rêveur est celui qui rêve
                                       de l'impossible."  (Elsa Triolet)                                        ICQ:#137121910