lua-users home
lua-l archive

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

> -----Original Message-----
> From:
> []On Behalf Of Enrico
> Colombini
> Sent: Thursday, March 25, 2004 3:10 AM
> To: Lua list
> Subject: Re: Why no metamethods for logical operators?
> On Wednesday 24 March 2004 18:24, Firestone, Rameses wrote:
> > My main problem is I need + for + and * for *. So this wouldn't
> > work for me. I can always use a function. The only problem is the
> > syntax doesn't look so clear.
> It's a question of tastes. I flirted with overridden 
> operators in the past, 
> then I reverted to functions because I find them clearer :-)
>   Enrico

One final word, for now I have alternate solution to my problem but I 
still think it would be nice to eventually be able to overwrite AND
and OR. I looked at the code a bit and while I don't fully understand 
it, it seems to be using the OP_TEST code to implement AND and OR. Is 
this code also used to implement other operations? in any case I 
suppose it would be necessary to break this op code up into several 
op codes to implement the overwriting properly. Just thinking out 
load again.