User Tools

Site Tools


ch2_1_cond

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
ch2_1_cond [2022/02/23 08:20] – created adminch2_1_cond [2024/05/05 10:50] (current) admin
Line 1: Line 1:
 **''COND''** **''COND''**
  
-''COND'' is a multi branched conditional in LISP and accepts any number arguments, that must be lists - clauses. Sequentially, first element of the list is evaluated. If the result is ''NIL'' the rest of the clause is ignored. If the first element is true (not ''NIL''), the following items in the clause are evaled as in ''PROGN'' and the result of the last is returned from the ''COND''+''COND'' is a multi branched conditional in LISP and accepts any number arguments, that must be lists - clauses. Sequentially, first element of the clause list is evaluated. If the result is ''NIL'' the rest of the clause is ignored. If the first element is true (not ''NIL''), the following items in the clause are evaled as in ''PROGN''the result of the last is returned from the ''COND'', and all the following clauses are ignored
  
 <code lisp> <code lisp>
Line 15: Line 15:
 2        2       
 </code> </code>
 +
 +When none of the clause conditions are true, the whole form returns ''NIL''. In the example above, the last form has the ''T'' as condition, so if none of the previous conditions apply, the last clause will be evaled.
 +
 +See also ''IF'', ''WHEN'', ''UNLESS'', ''AND'', ''OR'' 
ch2_1_cond.1645629617.txt.gz · Last modified: 2022/02/23 08:20 by admin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki