aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuc Teirlinck2004-04-17 00:58:04 +0000
committerLuc Teirlinck2004-04-17 00:58:04 +0000
commit3a424014a0c51bac48d79d4fb0e54a8ad77a7d2b (patch)
tree8b87c9d18aa84cf4acfdcc8d994b47643ef21091
parent948caddf0be648b04ce072ed2750977b8bab5c4e (diff)
downloademacs-3a424014a0c51bac48d79d4fb0e54a8ad77a7d2b.tar.gz
emacs-3a424014a0c51bac48d79d4fb0e54a8ad77a7d2b.zip
Various clarifications.
-rw-r--r--lispref/ChangeLog4
-rw-r--r--lispref/sequences.texi34
2 files changed, 23 insertions, 15 deletions
diff --git a/lispref/ChangeLog b/lispref/ChangeLog
index 6637064af48..1e04943f4f2 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,3 +1,7 @@
12004-04-16 Luc Teirlinck <teirllm@auburn.edu>
2
3 * sequences.texi: Various clarifications.
4
12004-04-14 Luc Teirlinck <teirllm@auburn.edu> 52004-04-14 Luc Teirlinck <teirllm@auburn.edu>
2 6
3 * buffers.texi (Read Only Buffers): Mention optional ARG to 7 * buffers.texi (Read Only Buffers): Mention optional ARG to
diff --git a/lispref/sequences.texi b/lispref/sequences.texi
index 06ac8c5f569..a9f997a5b2c 100644
--- a/lispref/sequences.texi
+++ b/lispref/sequences.texi
@@ -69,8 +69,8 @@ elements. This section describes functions that accept any kind of
69sequence. 69sequence.
70 70
71@defun sequencep object 71@defun sequencep object
72Returns @code{t} if @var{object} is a list, vector, 72Returns @code{t} if @var{object} is a list, vector, string,
73string, bool-vector, or char-table, @code{nil} otherwise. 73bool-vector, or char-table, @code{nil} otherwise.
74@end defun 74@end defun
75 75
76@defun length sequence 76@defun length sequence
@@ -80,12 +80,12 @@ string, bool-vector, or char-table, @code{nil} otherwise.
80@cindex sequence length 80@cindex sequence length
81@cindex char-table length 81@cindex char-table length
82This function returns the number of elements in @var{sequence}. If 82This function returns the number of elements in @var{sequence}. If
83@var{sequence} is a cons cell that is not a list (because the final 83@var{sequence} is a dotted list, a @code{wrong-type-argument} error is
84@sc{cdr} is not @code{nil}), a @code{wrong-type-argument} error is 84signaled. Circular lists may cause an infinite loop. For a
85signaled. For a char-table, the value returned is always one more 85char-table, the value returned is always one more than the maximum
86than the maximum Emacs character code. 86Emacs character code.
87 87
88@xref{List Elements}, for the related function @code{safe-length}. 88@xref{Definition of safe-length}, for the related function @code{safe-length}.
89 89
90@example 90@example
91@group 91@group
@@ -121,10 +121,11 @@ If @var{string} is a multibyte string, this is greater than
121@defun elt sequence index 121@defun elt sequence index
122@cindex elements of sequences 122@cindex elements of sequences
123This function returns the element of @var{sequence} indexed by 123This function returns the element of @var{sequence} indexed by
124@var{index}. Legitimate values of @var{index} are integers ranging from 124@var{index}. Legitimate values of @var{index} are integers ranging
1250 up to one less than the length of @var{sequence}. If @var{sequence} 125from 0 up to one less than the length of @var{sequence}. If
126is a list, then out-of-range values of @var{index} return @code{nil}; 126@var{sequence} is a list, out-of-range values behave as for
127otherwise, they trigger an @code{args-out-of-range} error. 127@code{nth}. @xref{Definition of nth}. Otherwise, out-of-range values
128trigger an @code{args-out-of-range} error.
128 129
129@example 130@example
130@group 131@group
@@ -151,7 +152,7 @@ otherwise, they trigger an @code{args-out-of-range} error.
151@end example 152@end example
152 153
153This function generalizes @code{aref} (@pxref{Array Functions}) and 154This function generalizes @code{aref} (@pxref{Array Functions}) and
154@code{nth} (@pxref{List Elements}). 155@code{nth} (@pxref{Definition of nth}).
155@end defun 156@end defun
156 157
157@defun copy-sequence sequence 158@defun copy-sequence sequence
@@ -171,6 +172,9 @@ the copy is itself a copy, not shared with the original's property
171list. However, the actual values of the properties are shared. 172list. However, the actual values of the properties are shared.
172@xref{Text Properties}. 173@xref{Text Properties}.
173 174
175This function does not work for dotted lists. Trying to copy a
176circular list may cause an infinite loop.
177
174See also @code{append} in @ref{Building Lists}, @code{concat} in 178See also @code{append} in @ref{Building Lists}, @code{concat} in
175@ref{Creating Strings}, and @code{vconcat} in @ref{Vector Functions}, 179@ref{Creating Strings}, and @code{vconcat} in @ref{Vector Functions},
176for other ways to copy sequences. 180for other ways to copy sequences.
@@ -472,9 +476,9 @@ each initialized to @var{object}.
472@defun vconcat &rest sequences 476@defun vconcat &rest sequences
473@cindex copying vectors 477@cindex copying vectors
474This function returns a new vector containing all the elements of the 478This function returns a new vector containing all the elements of the
475@var{sequences}. The arguments @var{sequences} may be any kind of 479@var{sequences}. The arguments @var{sequences} may be true lists,
476arrays, including lists, vectors, or strings. If no @var{sequences} are 480vectors, strings or bool-vectors. If no @var{sequences} are given, an
477given, an empty vector is returned. 481empty vector is returned.
478 482
479The value is a newly constructed vector that is not @code{eq} to any 483The value is a newly constructed vector that is not @code{eq} to any
480existing vector. 484existing vector.