An example in the tutorial section : "Defining Metamethods for a C Type" looks as follows:
I'm a bit confused about where the "constructor" is, I assume by default I'm wrapping a bunch of c-libraries into object oriented lua code, and I do not care about portability to canonical lua. Specifically I need to hook in the three core functions of object oriented programming for object lifetime management, edit
| ||||
add comment |
You'd need to wrap your
OR you could consider your point function as your create function; and just have an init method...
Note; all objects of the point type already have your metatable applied, so you dont need to attach methods or anything. It does seem a bit pointless to me.... why do you want to seperate creation and initialization?? | |||||||||||||
|
聯(lián)系客服