Previous Up Next

5.16.1 Context-dependent functions.

The + operator

The + operator is infixed and ’+’ is its prefixed version. The + operator will add numbers (see Section 5.8.2), concatenate strings (see Section 5.3.12), and convert a number to a string if necessary. Addition makes sense for other objects, and + can flexibly deal with them; the result of using the + operator depends on the nature of its arguments.

Examples

The -,* and / operators

The -, * and / operators (and their prefixed versions ’-’, ’*’ and ’/’), like the + operator, are flexible and operate on compound objects (such as lists and sequences), but don’t concatenate strings.

Examples of - and ’-’.

Examples of * and ’*’.

Examples of / and ’/’.


Previous Up Next