diff options
author | Glenn Morris <rgm@gnu.org> | 2013-10-09 13:17:20 -0400 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2013-10-09 13:17:20 -0400 |
commit | fa02290953acd2d0cda982d98ffd32e9f6873d28 (patch) | |
tree | 2a141d56f3222dceb56771b7cb5d606f9809362c /doc/lispref/control.texi | |
parent | 574411d08a399826fb02d7c2d71280d567e5d181 (diff) | |
download | emacs-fa02290953acd2d0cda982d98ffd32e9f6873d28.tar.gz |
Doc tweaks for cond
* doc/lispref/control.texi (Conditionals): Copyedits.
* src/eval.c (Fcond): Doc tweak.
Diffstat (limited to 'doc/lispref/control.texi')
-rw-r--r-- | doc/lispref/control.texi | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi index 70eabcd84a4..34a02aab69d 100644 --- a/doc/lispref/control.texi +++ b/doc/lispref/control.texi @@ -218,15 +218,11 @@ list is the @var{condition}; the remaining elements, if any, the @code{cond} tries the clauses in textual order, by evaluating the @var{condition} of each clause. If the value of @var{condition} is non-@code{nil}, the clause ``succeeds''; then @code{cond} evaluates its -@var{body-forms}, and the value of the last of @var{body-forms} becomes -the value of the @code{cond}. The remaining clauses are ignored. +@var{body-forms}, and returns the value of the last of @var{body-forms}. +Any remaining clauses are ignored. If the value of @var{condition} is @code{nil}, the clause ``fails'', so -the @code{cond} moves on to the following clause, trying its -@var{condition}. - -If every @var{condition} evaluates to @code{nil}, so that every clause -fails, @code{cond} returns @code{nil}. +the @code{cond} moves on to the following clause, trying its @var{condition}. A clause may also look like this: @@ -235,8 +231,11 @@ A clause may also look like this: @end example @noindent -Then, if @var{condition} is non-@code{nil} when tested, the value of -@var{condition} becomes the value of the @code{cond} form. +Then, if @var{condition} is non-@code{nil} when tested, the @code{cond} +form returns the value of @var{condition}. + +If every @var{condition} evaluates to @code{nil}, so that every clause +fails, @code{cond} returns @code{nil}. The following example has four clauses, which test for the cases where the value of @code{x} is a number, string, buffer and symbol, |