lua-users home
lua-l archive

Re: default table in C functions

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


Hello,
 [ gl:md2_display(model.get_data()) ]
The syntax above looks almost exactly backwards. You might consider
tweaking your function signatures to make it
 gl.md2_display(model:get_data())
Ok i remember now:
module:function(param) <=> module.function(module,param)
it seems only useful when using classes.
I thought that the colon syntax was the mandatory writing for using C modules. I've switched to the "more consistent" writing (that is for me module.function(closure:get_params()) . As expected, i got only my table pushed in the stack, which is better for consistency. I think it's time for reading again the PiL. My first reading was quite difficult ( "metatables and metamethods" is quite obscure for example), but with more practice, it should be easier.
Thank you for the details.

AltStyle によって変換されたページ (->オリジナル) /