From fa02290953acd2d0cda982d98ffd32e9f6873d28 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 9 Oct 2013 13:17:20 -0400 Subject: Doc tweaks for cond * doc/lispref/control.texi (Conditionals): Copyedits. * src/eval.c (Fcond): Doc tweak. --- doc/lispref/control.texi | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'doc/lispref/control.texi') 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, -- cgit v1.2.1