XLISP > XLISP 2.0  -  Contents  -  Reference  -  Previous | Next

21  The Program Feature


  1. prog - the program feature
  2. prog* - 'prog' with sequential binding
  3. block - named block
  4. return - cause a prog construct to return a value
  5. return-from - return from a named block
  6. tagbody - block with labels
  7. go - go to a tag within a tagbody or prog
  8. progv - dynamically bind symbols
  9. prog1 - return the value of the first expression
  10. prog2 - return the value of the second expression
  11. progn - return the value of the last expression

(prog (binding...) expr...) - the program feature
(prog* (binding...) expr...) - prog with sequential binding
binding - the variable bindings each of which is either:
1) a symbol [which is initialized to NIL]
2) a list whose car is a symbol and whose CADR is an initialization expression
expr - expressions to evaluate or tags [symbols]
returns - NIL or the argument passed to the return function

(block name expr...) - named block
name - the block name [symbol]
expr - the block body
returns - the value of the last expression

(return [expr]) - cause a prog construct to return a value
expr - the value [defaults to NIL]
returns - never returns

(return-from name [value]) - return from a named block
name - the block name [symbol]
value - the value to return [defaults to NIL]
returns - never returns

(tagbody expr...) - block with labels
expr - expression[s] to evaluate or tags [symbols]
returns - NIL

(go sym) - go to a tag within a tagbody or prog
sym - the tag [quoted]
returns - never returns

(progv slist vlist expr...) - dynamically bind symbols
slist - list of symbols
vlist - list of values to bind to the symbols
expr - expression[s] to evaluate
returns - the value of the last expression

(prog1 expr1 expr...) - execute expressions sequentially
expr1 - the first expression to evaluate
expr - the remaining expressions to evaluate
returns - the value of the first expression

(prog2 expr1 expr2 expr...) - execute expressions sequentially
expr1 - the first expression to evaluate
expr2 - the second expression to evaluate
expr - the remaining expressions to evaluate
returns - the value of the second expression

(progn expr...) - execute expressions sequentially
expr - the expressions to evaluate
returns - the value of the last expression [or NIL]

XLISP > XLISP 2.0  -  Contents  -  Reference  -  Previous | Next