emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Predicate for true lists


From: Eli Zaretskii
Subject: Re: Predicate for true lists
Date: Sat, 07 Jul 2018 19:12:47 +0300

> From: "Basil L. Contovounesios" <address@hidden>
> Cc: Paul Eggert <address@hidden>,  <address@hidden>
> Date: Sat, 07 Jul 2018 18:04:28 +0300
> 
> >    (and (listp object) (ignore-errors (length object)))
> >                         ^^^^^^^^^^^^^
> 
> The call to 'length' is wrapped in 'ignore-errors' in order to catch the
> errors signalled in 'Flength' by 'FOR_EACH_TAIL' (in case of
> circularity) and 'CHECK_LIST_END' (in case of dottedness).  'length'
> shouldn't signal a 'wrong-type-argument' for a non-sequence argument
> because it is only called on objects which satisfy 'listp':
> 
>     (and (listp object) (ignore-errors (length object)))
>          ^^^^^^^^^^^^^^

Yes, I know.

>  This function returns the number of elements in @var{sequence}.  If
> address@hidden is a dotted list, a @code{wrong-type-argument} error is
> -signaled; if it is a circular list, a @code{circular-list} error is
> -signaled.  For a char-table, the value returned is always one more
> -than the maximum Emacs character code.
> address@hidden does not satisfy @code{sequencep} or is a dotted list,

It is better to say "If the argument is not a sequence, or is a dotted
list, ...".

> +a @code{wrong-type-argument} error is signaled; if it is a circular

Please try to avoid passive tense, it usually makes the text longer
and less clear.  I'd suggest

  The function signals the @code{wrong-type-argument} error if the
  argument is not a sequence or is a dotted list; it signals the
  @code{circular-list} error if the argument is a circular list.

Thanks.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]