lua-users home
lua-l archive

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


> > Here is some code to play with. The first bit is your userdata binding,
the
> > second bit is the Lua register operator. Its a bit like trying to do
friend
> > operators in C++. You have to specify the operator explicitly using regop.
> > Hope this answers your question.
>
> Yes. I thought I would need something like this. I'm not entirely happy
> with the extra steps (one extra function call and a lookup in a table),
> but this method is indeed pratical and general.

Hopefully someone else will come up with a quicker solution or optimise mine
:-)

I'm sure there must be other ways of doing it using tagmethods which might be
quicker but a little messy, and probably more error prone(?)

Anyway its lunch now :-)
Nick