August Karlstrom
2005-05-09 20:07:55 UTC
Hello all,
I'm a bit confused by the equality operator in Oberon-2. Neither OOC nor
XDS will accept an expression of the form `x = y = b', where x and y
have the same (arbitrary) type and b is a boolean. I argue that it is
valid since equality associates from left to right; `x = y' evaluates to
a boolean which is then compared to the boolean b. Am I missing
something here? If it's valid I can see the strange implications---for
instance `b1 = b2 = b3' would be false if b1, b2 and b3 are all false
(all have the same value). Comments?
Regards,
August
I'm a bit confused by the equality operator in Oberon-2. Neither OOC nor
XDS will accept an expression of the form `x = y = b', where x and y
have the same (arbitrary) type and b is a boolean. I argue that it is
valid since equality associates from left to right; `x = y' evaluates to
a boolean which is then compared to the boolean b. Am I missing
something here? If it's valid I can see the strange implications---for
instance `b1 = b2 = b3' would be false if b1, b2 and b3 are all false
(all have the same value). Comments?
Regards,
August