MULTIPLE VALUE FUNCTIONS
XLISP-PLUS supports multiple return values (via a compilation option) as in Common Lisp. Note that most FSUBR control structure functions will pass back multiple return values, with the exceptions being PROG1 and PROG2.
BIND RETURN VALUES INTO LOCAL CONTEXT
(multiple-value-bind <varlist> <vform> [<form>...])
defined as macro in common.lsp
- <vform> form to be evaluated
- <varlist> list of variables to bind to return values of vform
- <form> forms evaluated sequentially, as in LET, using local bindings
- returns values of last form evaluated, or NIL if no forms
COLLECT VALUES AND APPLY FUNCTION
(multiple-value-call <fun> <form> ...)
fsubr
- <fun> function to apply
- <form> forms, which are evaluated, with result values collected
- returns result of applying fun to all of the returned values of the forms
COLLECT MULTIPLE RETURNED VALUES INTO A LIST
(multiple-value-list <form>)
defined as macro in common.lsp
- <form> form to be evaluated
- returns list of returned values
RETURN VALUES OF FIRST FORM
(multiple-value-prog1 <form> [<form> ...])
fsubr
- <form> one or more forms, which are evaluated sequentially
- returns the result values of the first form
BIND RETURN VALUES TO VARIABLES
(multiple-value-setq <varlist> <form>)
defined as macro in common.lsp
- <form> form to be evaluated
- <varlist> list of variables to bind to return values of form
- returns (undefined, implementation dependent)
EXTRACT A RETURN VALUE
(nth-value <index> <form>)
fsubr
- <index> index into return values
- <form> form which gets evaluated
- returns the nth result value of exectuing the form
RETURN MULTIPLE VALUES
(values [<expr>])
- <expr> expression(s) to be evaluated
- returns each argument as a separate value
RETURN MULTIPLE VALUES FROM LIST
(values-list <list>)
defined in common.lsp
- <list> a list
- returns each list element as a separate value
XLISP-PLUS - Version 2.1g - Tom Almy
tom.almy@tek.com - 18 JUL 94
Generated with WebMaker