unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#15558: [gnu.org #859332] Error in elisp on line documentation
       [not found] ` <CAB+Aj0vReBpxZx7C31hXZHB3_K=rzSbKOR5BtUiZ2bv9PuSw=Q@mail.gmail.com>
@ 2013-10-07 23:32   ` Robert Musial via RT
  2013-10-08 16:17     ` Glenn Morris
  0 siblings, 1 reply; 4+ messages in thread
From: Robert Musial via RT @ 2013-10-07 23:32 UTC (permalink / raw)
  Cc: 15558

Emacs team:

Below is another documentation improvement suggestion.

Thanks!


> [ke1g.nh@gmail.com - Thu Sep 26 12:06:21 2013]:
> 
> (Please forward to the appropriate document maintainer.)
> 
> I believe that I have found  an error in the description of cond at:
> 
> 
> http://www.gnu.org/software/emacs/manual/html_node/elisp/Conditionals.html
> 
> The description implies that the "condition" element of a clause is not
> included in "body-forms".  This is a reasonable separation, since (if the
> clause is reached) the condition is evaluated while the body-forms may or
> may not be (depending upon the condition's value).
> 
> But it goes on to say that the value (of the cond) is that of the last of
> the body-forms to be evaluated.  Yet it is perfectly legal for a clause to
> have no body-forms, only a condition.  In this case, if the condition is
> non-nil, that is, if the clause succeeds, the value of the cond will
be the
> value of the condition.  This is the last form evaluated, not the last of
> the body-forms evaluated (since none of the body-forms were evaluated).
> 
> You can confirm this behavior by evaluating the following (the result will
> be 3):
> 
> > (cond (3)(1 4))
> 
> The current text actually leaves the value undefined for this case.  It is
> a useful case, and should be correctly documented.
> 
> Perhaps something  like:
> 
> > ...and the value of the last of body-forms, or, if there are no
> body-forms in the clause, the value of the condition, becomes the value of
> the cond.
> 
> Bill (formerly f@ai. "Hi" to RMS if he's about)
> 
> 
-- 
Robert Musial - musial at gnu dot org - GPG key 533A1341
Join the FSF! http://www.fsf.org/register_form?referrer=9143






^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#15558: [gnu.org #859332] Error in elisp on line documentation
  2013-10-07 23:32   ` bug#15558: [gnu.org #859332] Error in elisp on line documentation Robert Musial via RT
@ 2013-10-08 16:17     ` Glenn Morris
  2013-10-08 17:32       ` Bill Freeman
  0 siblings, 1 reply; 4+ messages in thread
From: Glenn Morris @ 2013-10-08 16:17 UTC (permalink / raw)
  To: 15558; +Cc: ke1g.nh, webmasters-comment


"Robert Musial via RT" wrote:

>> Yet it is perfectly legal for a clause to have no body-forms, only a
>> condition.
[...]
>> The current text actually leaves the value undefined for this case.  It is
>> a useful case, and should be correctly documented.

It is documented (if a little clunkily):

    A clause may also look like this:

    (condition)

    Then, if condition is non-nil when tested, the value of condition
    becomes the value of the cond form. 


PS: Please report Emacs documentation issues via M-x report-emacs-bug
(or mail to bug-gnu-emacs@gnu.org) rather than emailing GNU webmasters.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#15558: [gnu.org #859332] Error in elisp on line documentation
  2013-10-08 16:17     ` Glenn Morris
@ 2013-10-08 17:32       ` Bill Freeman
  2013-10-09 17:19         ` Glenn Morris
  0 siblings, 1 reply; 4+ messages in thread
From: Bill Freeman @ 2013-10-08 17:32 UTC (permalink / raw)
  To: Glenn Morris

[-- Attachment #1: Type: text/plain, Size: 1049 bytes --]

Yes, thanks, I see that now.  (And I thought I was reading carefully.)

But might I suggest that the line:

    If every condition evaluates to nil, so that every clause fails,
condreturns
nil.
be placed after the line:

    Then, if condition is non-nil when tested, the value of
conditionbecomes the value of the
cond form.

Bill


On Tue, Oct 8, 2013 at 12:17 PM, Glenn Morris <rgm@gnu.org> wrote:

>
> "Robert Musial via RT" wrote:
>
> >> Yet it is perfectly legal for a clause to have no body-forms, only a
> >> condition.
> [...]
> >> The current text actually leaves the value undefined for this case.  It
> is
> >> a useful case, and should be correctly documented.
>
> It is documented (if a little clunkily):
>
>     A clause may also look like this:
>
>     (condition)
>
>     Then, if condition is non-nil when tested, the value of condition
>     becomes the value of the cond form.
>
>
> PS: Please report Emacs documentation issues via M-x report-emacs-bug
> (or mail to bug-gnu-emacs@gnu.org) rather than emailing GNU webmasters.
>

[-- Attachment #2: Type: text/html, Size: 1688 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#15558: [gnu.org #859332] Error in elisp on line documentation
  2013-10-08 17:32       ` Bill Freeman
@ 2013-10-09 17:19         ` Glenn Morris
  0 siblings, 0 replies; 4+ messages in thread
From: Glenn Morris @ 2013-10-09 17:19 UTC (permalink / raw)
  To: Bill Freeman; +Cc: 15558

(Please keep the debbugs address included in any replies.)

Bill Freeman wrote:

> But might I suggest that the line:
>
>     If every condition evaluates to nil, so that every clause fails,
> condreturns
> nil.
> be placed after the line:
>
>     Then, if condition is non-nil when tested, the value of
> conditionbecomes the value of the
> cond form.

OK, done in the Emacs sources. The online version will be regenerated at
time of next Emacs release.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-10-09 17:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <RT-Ticket-859332@rt.gnu.org>
     [not found] ` <CAB+Aj0vReBpxZx7C31hXZHB3_K=rzSbKOR5BtUiZ2bv9PuSw=Q@mail.gmail.com>
2013-10-07 23:32   ` bug#15558: [gnu.org #859332] Error in elisp on line documentation Robert Musial via RT
2013-10-08 16:17     ` Glenn Morris
2013-10-08 17:32       ` Bill Freeman
2013-10-09 17:19         ` Glenn Morris

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).