203 |
;;; simulated. Instead, multiple-value-bind and friends simply expect |
;;; simulated. Instead, multiple-value-bind and friends simply expect |
204 |
;;; the target form to return the values as a list. |
;;; the target form to return the values as a list. |
205 |
|
|
206 |
(defalias 'values 'list) |
(defsubst values (&rest values) |
207 |
(defalias 'values-list 'identity) |
"Return multiple values, Common Lisp style. |
208 |
(defalias 'multiple-value-list 'identity) |
The arguments of `values' are the values |
209 |
(defalias 'multiple-value-call 'apply) ; only works for one arg |
that the containing function should return." |
210 |
(defalias 'nth-value 'nth) |
(apply 'list values)) |
211 |
|
|
212 |
|
(defsubst values-list (list) |
213 |
|
"Return multiple values, Common Lisp style, taken from a list. |
214 |
|
LIST specifies the list of values |
215 |
|
that the containing function should return." |
216 |
|
list) |
217 |
|
|
218 |
|
(defsubst multiple-value-list (expression) |
219 |
|
"Return a list of the multiple values produced by EXPRESSION. |
220 |
|
This handles multiple values in Common Lisp style, but it does not |
221 |
|
work right when EXPRESSION calls an ordinary Emacs Lisp function |
222 |
|
that returns just one value." |
223 |
|
expression) |
224 |
|
|
225 |
|
(defsubst multiple-value-apply (function expression) |
226 |
|
"Evaluate EXPRESSION to get multiple values and apply FUNCTION to them. |
227 |
|
This handles multiple values in Common Lisp style, but it does not work |
228 |
|
right when EXPRESSION calls an ordinary Emacs Lisp function that returns just |
229 |
|
one value." |
230 |
|
(apply function expression)) |
231 |
|
|
232 |
|
(defsubst nth-value (n expression) |
233 |
|
"Evaluate EXPRESSION to get multiple values and return the Nth one. |
234 |
|
This handles multiple values in Common Lisp style, but it does not work |
235 |
|
right when EXPRESSION calls an ordinary Emacs Lisp function that returns just |
236 |
|
one value." |
237 |
|
(nth n expression)) |
238 |
|
|
239 |
;;; Macros. |
;;; Macros. |
240 |
|
|