[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re:Incorrect args for unary minus
- From: "mark gossage" <mark@...>
- Date: Thu, 12 Jul 2007 19:11:37 -0600
> > It reports that there are in fact two arguments
> (the table
> > repeated twice).
>
> > Is the manual wrong, or is there a bug in the
> code?
>
> It looks like this happens because the function Arith in
> lvm.c doesn't have a special case for the one unary
> arithmetical operator. This of course is not a problem
> unless you write a unary minus metamethod that looks for a
> second argument, which you probably shouldn't do.
>
> The Lua team can answer whether they consider this a bug (in
> the manual or the implementation).
>
I am going to call it a bug.
I was trying to add some extra code into SWIG which will complain if the number of arguments is incorrect. So if the lvm sends two args, then the argument checking code will spot that something is wrong.
This would then effect not just SWIG but any other autobinding routine which bothers to check the exact number of args (tolua luabind, etc).
I will have a look at lvm, but since I have never looked inside lua, I doubt if I will be able to fix it.
Regards,
Mark