THE PROGRAM FEATURE
THE PROGRAM FEATURE
(prog (<binding>...) <expr>...)
PROG WITH SEQUENTIAL BINDING
(prog* (<binding>...) <expr>...)
fsubr -- equivalent to (let () (block NIL (tagbody ...)))
- <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
NAMED BLOCK
(block <name> <expr>...)
fsubr
- <name> the block name (quoted symbol)
- <expr> the block body
- returns the value of the last expression
CAUSE A PROG CONSTRUCT TO RETURN A VALUE
(return [<expr>])
fsubr
- <expr> the value (defaults to NIL)
- returns never returns
RETURN FROM A NAMED BLOCK OR FUNCTION
(return-from <name> [<value>])
fsubr. In traditional Xlisp, the names are dynamically scoped. A compilation option (default) uses lexical scoping like Common Lisp.
- <name> the block or function name (quoted symbol). If name is NIL, use function RETURN.
- <value> the value to return (defaults to NIL)
- returns never returns
BLOCK WITH LABELS
(tagbody <expr>...)
fsubr
- <expr> expression(s) to evaluate or tags (symbols)
- returns NIL
GO TO A TAG WITHIN A TAGBODY
(go <sym>)
fsubr. In traditional Xlisp, tags are dynamically scoped. A compilation option (default) uses lexical scoping like Common Lisp.
- <sym> the tag (quoted)
- returns never returns
DYNAMICALLY BIND SYMBOLS
(progv <slist> <vlist> <expr>...)
fsubr
- <slist> list of symbols (evaluated)
- <vlist> list of values to bind to the symbols (evaluated)
- <expr> expression(s) to evaluate
- returns the value of the last expression
EXECUTE EXPRESSIONS SEQUENTIALLY
(prog1 <expr1> <expr>...)
fsubr
- <expr1> the first expression to evaluate
- <expr> the remaining expressions to evaluate
- returns the value of the first expression
EXECUTE EXPRESSIONS SEQUENTIALLY
(prog2 <expr1> <expr2> <expr>...)
fsubr
- <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
EXECUTE EXPRESSIONS SEQUENTIALLY
(progn <expr>...)
fsubr
- <expr> the expressions to evaluate
- returns the value of the last expression (or NIL)
XLISP-PLUS - Version 2.1g - Tom Almy
tom.almy@tek.com - 18 JUL 94
Generated with WebMaker