[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Need for help
- From: "Peter Hill" <corwin@...>
- Date: Mon, 24 Feb 2003 13:29:35 +0800
>> Also, the question of binary operators: they must be the same type. So
>> c = udata( 4 )
>> d = 6
>> if c < d -- assertion failure
>> then
>>
>> what if my metamethod __lt can cope with any type ?
Rici Lake:
> I take your point here, but it is a contentious issue. OO languages do
> not deal very well with binary operators, and there is much debate about
> this issue. What if c and d both have _lt metamethods? Which one wins?
> Why should it be the first one (if that is what you are thinking)?
>
> Binary dispatch is probably the answer, but that is complicated (and
> can be slow, too.)
Rici, what did you think of my post a while back that suggested removing the
current internally defined dispatch routine, instead allowing users to
define their own to suit their needs?
*cheers*
Peter Hill.
Ki: Contractors... high-paid leeches stealing our work.
Fooker: If you think of them as disposable employees, you'll feel much
better...