Afaik, it should work fine. Comparisons are operators, evaluated in
order with the rest of them (+, -, &, etc.)
Therefore for i = 5:
#i gt 0 lt 4# = #0 lt 4$ = Yes
#i eq 0 eq 1# = #0 eq 1# = No
#i eq 5 lt 4# = #1 lt 4# = Yes
..and so on.
-Joe
On Wed, 10 Nov 2004 23:56:21 +, Andy Jarrett <
No, it's behaving correctly, you've just found one of the edge cases
with a loosely typed language. That second expression is equivalent
to this one:
(i GT 0) LT 4
the "i GT 0" part evaluates to true. It's then used in a numeric
context, so it is coerced to the numeric version of true, which is
Came across a weird one (or so i think)
#i GT 0 AND i LT 4#
Returns NO - expected
#i GT 0 LT 4#
Return Yes - not expected
With the second snippet surely this should error??
Andy
www.andyjarrett.co.uk
~|
Special thanks to the
3 matches
Mail list logo