[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Predicate for true lists
From: |
Basil L. Contovounesios |
Subject: |
Re: Predicate for true lists |
Date: |
Sat, 07 Jul 2018 20:06:01 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Eli Zaretskii <address@hidden> writes:
>> Cc: address@hidden, address@hidden
>> From: Paul Eggert <address@hidden>
>> Date: Sat, 7 Jul 2018 01:41:38 -0700
>>
>> Eli Zaretskii wrote:
>> > the documentation still doesn't say that 'length' signals
>> > an error for anything that is not a sequence, which is what
>> > proper-list-p is relying on.
>>
>> The proposed implementation of proper-list-p does not rely on such a signal,
>
> That's not my reading of the implementation:
>
> (and (listp object) (ignore-errors (length object)))
> ^^^^^^^^^^^^^
Sorry, I completely overlooked Paul's message[1] that you were replying
to. I now understand what you meant by your reading of the
implementation.
Given that the two of you suggested both the need for the doc fix and
its wording, I think you should ignore my patch[2] and push the change
yourself. Here is yet another updated patch, should you disagree:
>From 79c6e0e80ebdcd0066654d72514dd08891155a77 Mon Sep 17 00:00:00 2001
From: "Basil L. Contovounesios" <address@hidden>
Date: Sat, 7 Jul 2018 19:33:08 +0300
Subject: [PATCH] Fix (length NON-SEQUENCE) documentation
Suggested by Eli Zaretskii <address@hidden> and
Paul Eggert <address@hidden> in the following threads:
https://lists.gnu.org/archive/html/emacs-devel/2018-07/msg00171.html
https://lists.gnu.org/archive/html/emacs-devel/2018-07/msg00177.html
https://lists.gnu.org/archive/html/emacs-devel/2018-07/msg00206.html
* doc/lispref/sequences.texi (Sequence Functions): Mention that
'length' signals a 'wrong-type-argument' also when given a
non-sequencep argument.
---
doc/lispref/sequences.texi | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/doc/lispref/sequences.texi b/doc/lispref/sequences.texi
index 59faf2b4f1..188a345114 100644
--- a/doc/lispref/sequences.texi
+++ b/doc/lispref/sequences.texi
@@ -71,13 +71,15 @@ Sequence Functions
@cindex list length
@cindex vector length
@cindex sequence length
address@hidden bool-vector length
@cindex char-table length
@anchor{Definition of length}
-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.
+This function returns the number of elements in @var{sequence}. The
+function signals the @code{wrong-type-argument} error if the argument
+is not a sequence or is a dotted list; it signals the
address@hidden error if the argument is a circular list. For a
+char-table, the value returned is always one more than the maximum
+Emacs character code.
@xref{Definition of safe-length}, for the related function @code{safe-length}.
--
2.18.0
[1]: https://lists.gnu.org/archive/html/emacs-devel/2018-07/msg00177.html
[2]: https://lists.gnu.org/archive/html/emacs-devel/2018-07/msg00207.html
Thanks,
--
Basil
- Re: Predicate for true lists, (continued)
- Re: Predicate for true lists, Basil L. Contovounesios, 2018/07/07
- Re: Predicate for true lists, Eli Zaretskii, 2018/07/07
- Re: Predicate for true lists, Paul Eggert, 2018/07/07
- Re: Predicate for true lists, Eli Zaretskii, 2018/07/07
- RE: Predicate for true lists, Drew Adams, 2018/07/07
- Re: Predicate for true lists, Paul Eggert, 2018/07/08
- RE: Predicate for true lists, Drew Adams, 2018/07/08
- Re: Predicate for true lists, Paul Eggert, 2018/07/08
- RE: Predicate for true lists, Drew Adams, 2018/07/08
- Re: Predicate for true lists, Paul Eggert, 2018/07/08
- Re: Predicate for true lists,
Basil L. Contovounesios <=
Re: Predicate for true lists, Basil L. Contovounesios, 2018/07/09
- Re: Predicate for true lists, Basil L. Contovounesios, 2018/07/09
- Re: Predicate for true lists, Paul Eggert, 2018/07/09
- Re: Predicate for true lists, Basil L. Contovounesios, 2018/07/10
- Re: Predicate for true lists, Paul Eggert, 2018/07/10
- Re: Predicate for true lists, Basil L. Contovounesios, 2018/07/11
- Re: Predicate for true lists, Wilfred Hughes, 2018/07/15
- Re: Predicate for true lists, Paul Eggert, 2018/07/15
Re: [Emacs-diffs] master babe0d4: Rearrange definition of zerop in subr.el, Karl Fogel, 2018/07/11
Re: [Emacs-diffs] master babe0d4: Rearrange definition of zerop in subr.el, Basil L. Contovounesios, 2018/07/11