Re: [If/then and sequences...]

new topic     » topic index » view thread      » older message » newer message

>
>It's a source of confusion to new users of the language, and is one of the
>few things in the language that I *really* despise. I really wish that
>Robert had instead written eq/lt/gt functions, for the few times that sort
>of thing is needed. I suspect that if Robert changed the current behavior,
>very little code would break.
>
>-- David Cuny
>
You're right David. Allowing =, >, <, >=, <=, != in IF statements that use
two sequences would not break existing code because no existing code uses
this now. In fact, all the interpreter would have to do is (silently)
translate the operator in to the appropriate compare() function.

*----------------------------------*
| Symbol  |   equivalent compare() |
|---------+------------------------|
| x = y   |   compare(x,y) =  0    |
| x != y  |   compare(x,y) != 0    |
| x < y   |   compare(x,y) <  0    |
| x > y   |   compare(x,y) >  0    |
| x <= y  |   compare(x,y) <= 0    |
| x >= y  |   compare(x,y) >= 0    |
*----------------------------------*

That should be too hard to do either.

----
cheers
Derek

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu