cond


(cond  [ (test1  expressions1) [ (test2  expressions2) ... ]] )

This function is the Lisp variant of a "switch / case" statement, combining several if + then statements into a compact expression.

Arguments

test1  any Lisp expression; if it evaluates to non-NIL, then its branch code is processed; T can be used as last default option

expressions1  any 
:
and so on

Return

result of last evaluated branch code (from expressionsX)

Example

(cond
   ((stringp x) (runString x))
   ((numberp x)  (runNumber x))
   (T (runAnyOther x))
)

Remarks




©  Bricsys NV. All rights reserved.