next up previous
Contents Next: - (FUNCTION) Up: Appendix: Selected LISP Previous: * (FUNCTION)

+ (FUNCTION)

Format: (+ <exp1> <exp2> ...)

Required arguments: None.

Argument expressions must evaluate to numbers.

Argument expressions are evaluated and their sum is computed. See below for special cases of zero or one arguments.

Examples:

>(+ 4 5 6)
15

>(+ 123.5 12/3)
127.5

>(+ (* 2 3) 8)
14

>(+ 'a 1)
Error: A is not of type NUMBER.

Special Cases:

>(+ 3)
3

>(+)
0



© Colin Allen & Maneesh Dhagat
November 1999