if

(if test_expression then_expression [else_expression])

The if function performs a conditional evaluation.

The function returns the result of the last expression evaluated.

Examples

: (if Test 1 2)

2

: (if (= x 1) (setq ret "Yes")(setq ret "No"))

"No"

: (if (/= x 3) (progn (princ "Not equal 3!")(terpri)(setq x 3)))

Not equal 3!

3

Related Functions

progn