aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/emacs-lisp/cl.el
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>2001-11-16 00:00:22 +0000
committerRichard M. Stallman <[email protected]>2001-11-16 00:00:22 +0000
commit413da4514b106c81cecbfb5b7cd80b42f6b29d31 (patch)
tree6fcb2239fa847f8879920774e9cc5d0caf1190fe /lisp/emacs-lisp/cl.el
parent6f665da94994bf054a6d9a01e0337f455991cfdc (diff)
(values, values-list, multiple-value-list, multiple-value-apply, nth-value):
Use defsubst rather than defalias, to get better doc strings.
Diffstat (limited to 'lisp/emacs-lisp/cl.el')
-rw-r--r--lisp/emacs-lisp/cl.el36
1 files changed, 31 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/cl.el b/lisp/emacs-lisp/cl.el
index f77c15414a..970d918027 100644
--- a/lisp/emacs-lisp/cl.el
+++ b/lisp/emacs-lisp/cl.el
@@ -203,12 +203,38 @@ Keywords supported: :test :test-not :key"
;;; simulated. Instead, multiple-value-bind and friends simply expect
;;; the target form to return the values as a list.
-(defalias 'values 'list)
-(defalias 'values-list 'identity)
-(defalias 'multiple-value-list 'identity)
-(defalias 'multiple-value-call 'apply) ; only works for one arg
-(defalias 'nth-value 'nth)
+(defsubst values (&rest values)
+ "Return multiple values, Common Lisp style.
+The arguments of `values' are the values
+that the containing function should return."
+ (apply 'list values))
+
+(defsubst values-list (list)
+ "Return multiple values, Common Lisp style, taken from a list.
+LIST specifies the list of values
+that the containing function should return."
+ list)
+(defsubst multiple-value-list (expression)
+ "Return a list of the multiple values produced by EXPRESSION.
+This handles multiple values in Common Lisp style, but it does not
+work right when EXPRESSION calls an ordinary Emacs Lisp function
+that returns just one value."
+ expression)
+
+(defsubst multiple-value-apply (function expression)
+ "Evaluate EXPRESSION to get multiple values and apply FUNCTION to them.
+This handles multiple values in Common Lisp style, but it does not work
+right when EXPRESSION calls an ordinary Emacs Lisp function that returns just
+one value."
+ (apply function expression))
+
+(defsubst nth-value (n expression)
+ "Evaluate EXPRESSION to get multiple values and return the Nth one.
+This handles multiple values in Common Lisp style, but it does not work
+right when EXPRESSION calls an ordinary Emacs Lisp function that returns just
+one value."
+ (nth n expression))
;;; Macros.