[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Why no metamethods for logical operators?
- From: Roberto Ierusalimschy <roberto@...>
- Date: Wed, 24 Mar 2004 12:28:38 -0300
> I understand that there may be some complications because of short-cut
> evaluation, but it seems that this could be handled similar to C++
> (i.e. just eliminate short-cut evaluation in overloading situations).
> [...] In any case does anyone know if there is a chance this feature
> might be added in the future?
There are some problems. First, those operators already have a clear
meaning for all values in Lua. Second, unlike C++, Lua would have to
decide on runtime whether it should use short-cut evaluation or not.
This does not seem very good for the precompiler. So, unless someone
can show a simple, small, and efficient implementation, we are not
considering this feature.
> I am working on layout processing software and I find it would be useful
> to overload these operators in order to specify design rules.
Have you exhausted the other six operators? (+ - * / .. ^)