If


Conditional structure (I)



    (if logical_expression
        do_statement
    )



  

Using progn, the single do_statement can be replaced by a block of statements:

    (if logical_expression
        (progn
            do_statements
        )
    )



Examples

    (if (< 0 1.5) "yes")

"yes"

    (if (= 2.5 3.5) "yes")

nil

    (test_if 0)

    (test_if 1)

This website has been archived and is no longer maintained.