CONTROL CONSTRUCTS



EVALUATE CONDITIONALLY

(cond <pair>...)

fsubr

where

  • returns the value of the first expression whose predicate is not NIL

    THE LOGICAL AND OF A LIST OF EXPRESSIONS

    (and <expr>...)

    fsubr


    THE LOGICAL OR OF A LIST OF EXPRESSIONS

    (or <expr>...)

    fsubr


    EVALUATE EXPRESSIONS CONDITIONALLY

    (if <texpr> <expr1> [<expr2>])

    fsubr


    EVALUATE ONLY WHEN A CONDITION IS TRUE

    (when <texpr> <expr>...)

    fsubr


    EVALUATE ONLY WHEN A CONDITION IS FALSE

    (unless <texpr> <expr>...)

    fsubr


    SELECT BY CASE

    (case <expr> <case>...[(t <expr>)])

    fsubr

    where:

  • (t <expr>) default case (no previous matching)
  • returns the value of the last expression of the matching case

    CREATE LOCAL BINDINGS

    (let (<binding>...) <expr>...)

    LET WITH SEQUENTIAL BINDING

    (let* (<binding>...) <expr>...)

    fsubr


    CREATE LOCAL FUNCTIONS

    (flet (<binding>...) <expr>...)

    FLET WITH RECURSIVE FUNCTIONS

    (labels (<binding>...) <expr>...)

    CREATE LOCAL MACROS

    (macrolet (<binding>...) <expr>...)

    fsubr

    where:

  • <expr> the expressions to be evaluated
  • returns the value of the last expression

    EVALUATE EXPRESSIONS AND CATCH THROWS

    (catch <sym> <expr>...)

    fsubr


    THROW TO A CATCH

    (throw <sym> [<expr>])

    fsubr


    PROTECT EVALUATION OF AN EXPRESSION

    (unwind-protect <expr> <cexpr>...)

    fsubr

    Note: unwind-protect guarantees to execute the cleanup expressions even if a non-local exit terminates the evaluation of the protected expression


    XLISP-PLUS - Version 2.1g - Tom Almy tom.almy@tek.com - 18 JUL 94
    Generated with
    WebMaker