STR-757: "lt" comparison succeeds for non-integer/real couples.
As the definition of “lt” is “not(geq)” lt will succeed for every term where “geq” fails.
Unfortunately this also include comparison of couple that are not necessary integer/real couples.(Foo(), Bar()) succeeds
Submitted on 11 August 2008 at 11:17
Issue Log
STR-757, karltk:
I’m not entirely certain this is a bug or not.We use fail/succeed to signal whether t1 is less than t2 ( (t1, t2)). For (Foo(), Bar()), it’s just not defined. Success and failure are both equally wrong if you expect lt to compare numbers.
If you change lt to fail for non-numbers, the code using lt erroneously like you show, would in all likelihood assume that t1 is geq than t2 when lt fails. I don’t see that this is any better.
We should really throw an exception, but we don’t have any in Stratego.
Log in to post comments