lua-users home
lua-l archive

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


On 19/02/2010, at 8:37 PM, steve donovan wrote:

> On Thu, Feb 18, 2010 at 11:52 PM, Geoff Leyland
> <geoff_leyland@fastmail.fm> wrote:
>> 
>> Is this of interest to anyone else?  (I'd like to use it to write lp constraints: x + y <= 3, rather than rima.constraint:new(x + y, "<=", 3) )
> 
> I've hit this one in almost exactly the same context.

Really?  May I ask in exactly what context?

> The question would be, would it slow down the relational operators
> significantly if they were generalized in this fashion?

I imagine that at the moment all the mechanisms are there: metatables are respected if they match, and any value you return is converted to boolean in the operator.  Presumably the default ordering function for table.sort would have to take on some of this load, but it's only moving work from one place to another, not creating it.  Where else might there be an effect?