Conditional structure (II)
(if logical_expression do_statement_1 else_do_statement_2 )
Examples
(if (= 1 2) "yes" "no") |
"no" |
(defun test_if_else (input) (if (= input 0) (progn (princ "First, do this.\n") (princ "Then, do that.") (princ)) (progn (princ "Else, do nothing.") (princ)) ) )
(test_if_else 0) |
|
(test_if_else 1) |
This website has been archived and is no longer maintained.