lua-users home
lua-l archive

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


Roberto Ierusalimschy wrote:
> 
> I think that someone that puts a non-associative tag method into '+' is
> asking for hard-to-find bugs ;-)

I think, the problem is that you don't know which tag method is called,
that of the left or that of the right operand.  If both are of the same
type there's no problem but if they differ you get a not-so-nice behaviour
and the annoying effect that the tag method itself has to check whether
its first or second arg is the "correct" type.

In Sol I only check the tag method of the left operand (with fallback
to nil:<method>) and lessthan will only call the tag method if both
operands are the same type (else nil:lt).  (Obbug: '^' and '..' should
call its right operand?)

Ciao, ET.