[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Odd result from arithmetic with nil
- From: Steve Heller <steveheller@...>
- Date: Wed, 10 Oct 2007 15:22:05 -0700 (PDT)
It's my mistake. After rereading the explanation of
the arithmetic metamethods, I understand the problem
is that the interpreter will use a __sub metamethod
from the second argument if the first one doesn't have
one, which of course nil doesn't.
Sorry for the inconvenience.
--- Luiz Henrique de Figueiredo
> > I have some code that creates an object of a date
> > (very similar to the one from PIL) and then
> > it from nil. I would expect this to raise the
> > to perform arithmetic on a nil value" error, but
> > doesn't; instead, I get a result of nil. Does this
> > make any sense?
> Perhaps this is related to
> http://www.lua.org/bugs.html#5.1.2-2 ?
> > I can post code if it would help.
> Please do.