next up previous
Next: Type Errors Up: Expressions Previous: Expressions

Boolean Operations

Here is how you write and, not and or:

// simple boolean expressions
true & false;
! true;
true | false;
You can also compare integers and reals with <, >, <= and >= as in
( 1.0 < 2 ) | ( 3.0 >= -7 & 3.0 > 5.0 ) | false;
liberally mixing integers and reals and putting in parentheses.

Finally, you can test for equality and inequality of booleans, integers, reals, strings and lists as in

1 = 2 | "a" != "b" | {1,2,3} = {4,5};
Test the equality of other types in not supported.

Warning: In ccli ``='' means ``equals'' and testes for equality of its arguments. It does not perform variable assignment, as in some other languages. Assignments are done with the ``:='' operator.



Eric Klavins 2003-12-03