Node: Iteration and Tests, Next: , Previous: Structures, Up: Top



Iteration and Tests

DO-EXTERNAL-SYMBOLS Macro
Package:LISP

Syntax:

          (do-external-symbols (var [package [result-form]])
                    {decl}* {tag | statement}*)
          

Executes STATEMENTs once for each external symbol in the PACKAGE (which defaults to the current package), with VAR bound to the current symbol. Then evaluates RESULT-FORM (which defaults to NIL) and returns the value(s).

DO* Special Form
Package:LISP

Syntax:

          (do* ({(var [init [step]])}*) (endtest {result}*)
                    {decl}* {tag | statement}*)
          

Just like DO, but performs variable bindings and assignments in serial, just like LET* and SETQ do.

DO-ALL-SYMBOLS Macro
Package:LISP

Syntax:

          (do-all-symbols (var [result-form]) {decl}* {tag | statement}*)
          

Executes STATEMENTs once for each symbol in each package, with VAR bound to the current symbol. Then evaluates RESULT-FORM (which defaults to NIL) and returns the value(s).

YES-OR-NO-P (&optional (format-string nil) &rest args) Function
Package:LISP

Asks the user a question whose answer is either 'YES' or 'NO'. If FORMAT- STRING is non-NIL, then FRESH-LINE operation is performed, a message is printed as if FORMAT-STRING and ARGs were given to FORMAT, and then a prompt "(Yes or No)" is printed. Otherwise, no prompt will appear.

MAPHASH #'hash-table Function
Package:LISP

For each entry in HASH-TABLE, calls FUNCTION on the key and value of the entry; returns NIL.

MAPCAR (fun list &rest more-lists) Function
Package:LISP

Applies FUN to successive cars of LISTs and returns the results as a list.

DOLIST Special Form
Package:LISP

Syntax:

          (dolist (var listform [result]) {decl}* {tag | statement}*)
          

Executes STATEMENTs, with VAR bound to each member of the list value of LISTFORM. Then returns the value(s) of RESULT (which defaults to NIL).

EQ (x y) Function
Package:LISP

Returns T if X and Y are the same identical object; NIL otherwise.

EQUALP (x y) Function
Package:LISP

Returns T if X and Y are EQUAL, if they are characters and satisfy CHAR-EQUAL, if they are numbers and have the same numerical value, or if they have components that are all EQUALP. Returns NIL otherwise.

EQUAL (x y) Function
Package:LISP

Returns T if X and Y are EQL or if they are of the same type and corresponding components are EQUAL. Returns NIL otherwise. Strings and bit-vectors are EQUAL if they are the same length and have identical components. Other arrays must be EQ to be EQUAL.

DO-SYMBOLS Macro
Package:LISP

Syntax:

          (do-symbols (var [package [result-form]]) {decl}* {tag |
          statement}*)
          

Executes STATEMENTs once for each symbol in the PACKAGE (which defaults to the current package), with VAR bound to the current symbol. Then evaluates RESULT-FORM (which defaults to NIL) and returns the value(s).

LOOP Special Form
Package:LISP

Syntax:

          (loop {form}*)
          

Executes FORMs repeatedly until exited by a THROW or RETURN. The FORMs are surrounded by an implicit NIL block.