(/= item1 item2 ...)
The two aren't equal.
This function tells you if two items are not equal:
- If item1 does not equal item2, this function returns a T (true).
- If the two items are equal, this function returns nil (false).
When more than two items are given, each item must be different to return a T. The items can be numbers or strings.
Examples
This expression | Returns |
---|---|
(/= 5 4) | T |
(/= 8.0 8) | nil |
(/= "x" "x" "x") | nil |
(/= "x" "x" "y") | nil |
(/= "x" "y" "z") | T |
(/= 5) | T |
NOTE Comparison statements (such as = (equal to operator) and < (less than operator) are typically used together with conditional statements, such as if...then, while, and cond. The comparisons let you test a pair of conditions (for example, does i= 0) to know when to exit the conditional (for example, while i > 0).