Character conversions. The ord and chr functions are used for character conversions:
String concatenation. The ∧ append operator is used for string concatenation:
Arithmetic. The infix binary1 operators +, -, and * only accept two values of type int or two values of type real; the prefix unary minus operator ∼ accepts a value of type int or real; the infix binary division operator / only accepts two values of type real; the infix binary division operator div only accepts two values of type int; and the infix binary modulus operator mod only accepts two values of type int.
Comparison. The infix binary operators = (equal to), <, >, <=, >=, and <> (not equal to) compare ints, reals, chars, or strings with one exception: reals may not be compared using = or <>. Instead, use the prefix functions Real.== and Real.!=. For now, we can think of Real as an object (in an object-oriented program), == as a message, and the expression Real.== as sending the message == to the object Real, which in turn executes the method definition of the message. Real is called a structure in ML (Section B.10). Structures are used again in Section B.12.
Boolean operators. The infix operators orelse, andalso (not to be confused with and), and not are the or, and, and not boolean operators with their usual semantics. The operators orelse and andalso use short-circuit evaluation (or lazy evaluation, as discussed in Chapter 12):
Conditionals. Use if–then–else expressions:
There is no if expression without an else because all expressions must return a value.
Comments.
The explode and implode functions:
1. Technically, all operators in ML are unary operators, in that each accepts a single argument that is a pair. However, generally, though not always, there is no problem interpreting a unary operator that only accepts a single pair as a binary operator.
3.16.218.221