diff options
| author | Basil L. Contovounesios | 2018-07-10 19:51:28 -0700 |
|---|---|---|
| committer | Paul Eggert | 2018-07-10 19:54:31 -0700 |
| commit | db3874b16192142f473d53e3b80213ad74d19eff (patch) | |
| tree | 24fb2f5e7fd700b7c2550512284bf4fa25f9d4ff /doc | |
| parent | 35e0305dc2a57cea6fcb515db9e0b0f938daf53a (diff) | |
| download | emacs-db3874b16192142f473d53e3b80213ad74d19eff.tar.gz emacs-db3874b16192142f473d53e3b80213ad74d19eff.zip | |
Refer to "proper lists" instead of "true lists"
* doc/lispref/lists.texi (Cons Cells, Building Lists):
* doc/lispref/sequences.texi (Vector Functions): Use the more
popular term "proper", rather than "true", to qualify nil-terminated
lists.
For discussion, see the following emacs-devel subthreads:
https://lists.gnu.org/archive/html/emacs-devel/2018-06/msg00112.html
https://lists.gnu.org/archive/html/emacs-devel/2018-06/msg00138.html
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/lispref/lists.texi | 23 | ||||
| -rw-r--r-- | doc/lispref/sequences.texi | 2 |
2 files changed, 14 insertions, 11 deletions
diff --git a/doc/lispref/lists.texi b/doc/lispref/lists.texi index 431f5fbbab2..e05633a881d 100644 --- a/doc/lispref/lists.texi +++ b/doc/lispref/lists.texi | |||
| @@ -50,16 +50,19 @@ convention; at the level of cons cells, the @sc{car} and @sc{cdr} | |||
| 50 | slots have similar properties). Hence, the @sc{cdr} slot of each cons | 50 | slots have similar properties). Hence, the @sc{cdr} slot of each cons |
| 51 | cell in a list refers to the following cons cell. | 51 | cell in a list refers to the following cons cell. |
| 52 | 52 | ||
| 53 | @cindex proper list | ||
| 53 | @cindex true list | 54 | @cindex true list |
| 54 | Also by convention, the @sc{cdr} of the last cons cell in a list is | 55 | Also by convention, the @sc{cdr} of the last cons cell in a list is |
| 55 | @code{nil}. We call such a @code{nil}-terminated structure a | 56 | @code{nil}. We call such a @code{nil}-terminated structure a |
| 56 | @dfn{true list}. In Emacs Lisp, the symbol @code{nil} is both a | 57 | @dfn{proper list}@footnote{It is sometimes also referred to as a |
| 57 | symbol and a list with no elements. For convenience, the symbol | 58 | @dfn{true list}, but we generally do not use this terminology in this |
| 58 | @code{nil} is considered to have @code{nil} as its @sc{cdr} (and also | 59 | manual.}. In Emacs Lisp, the symbol @code{nil} is both a symbol and a |
| 59 | as its @sc{car}). | 60 | list with no elements. For convenience, the symbol @code{nil} is |
| 60 | 61 | considered to have @code{nil} as its @sc{cdr} (and also as its | |
| 61 | Hence, the @sc{cdr} of a true list is always a true list. The | 62 | @sc{car}). |
| 62 | @sc{cdr} of a nonempty true list is a true list containing all the | 63 | |
| 64 | Hence, the @sc{cdr} of a proper list is always a proper list. The | ||
| 65 | @sc{cdr} of a nonempty proper list is a proper list containing all the | ||
| 63 | elements except the first. | 66 | elements except the first. |
| 64 | 67 | ||
| 65 | @cindex dotted list | 68 | @cindex dotted list |
| @@ -71,10 +74,10 @@ Pair Notation}). There is one other possibility: some cons cell's | |||
| 71 | @sc{cdr} could point to one of the previous cons cells in the list. | 74 | @sc{cdr} could point to one of the previous cons cells in the list. |
| 72 | We call that structure a @dfn{circular list}. | 75 | We call that structure a @dfn{circular list}. |
| 73 | 76 | ||
| 74 | For some purposes, it does not matter whether a list is true, | 77 | For some purposes, it does not matter whether a list is proper, |
| 75 | circular or dotted. If a program doesn't look far enough down the | 78 | circular or dotted. If a program doesn't look far enough down the |
| 76 | list to see the @sc{cdr} of the final cons cell, it won't care. | 79 | list to see the @sc{cdr} of the final cons cell, it won't care. |
| 77 | However, some functions that operate on lists demand true lists and | 80 | However, some functions that operate on lists demand proper lists and |
| 78 | signal errors if given a dotted list. Most functions that try to find | 81 | signal errors if given a dotted list. Most functions that try to find |
| 79 | the end of a list enter infinite loops if given a circular list. | 82 | the end of a list enter infinite loops if given a circular list. |
| 80 | 83 | ||
| @@ -522,7 +525,7 @@ object. The final argument is not copied or converted; it becomes the | |||
| 522 | is itself a list, then its elements become in effect elements of the | 525 | is itself a list, then its elements become in effect elements of the |
| 523 | result list. If the final element is not a list, the result is a | 526 | result list. If the final element is not a list, the result is a |
| 524 | dotted list since its final @sc{cdr} is not @code{nil} as required | 527 | dotted list since its final @sc{cdr} is not @code{nil} as required |
| 525 | in a true list. | 528 | in a proper list (@pxref{Cons Cells}). |
| 526 | @end defun | 529 | @end defun |
| 527 | 530 | ||
| 528 | Here is an example of using @code{append}: | 531 | Here is an example of using @code{append}: |
diff --git a/doc/lispref/sequences.texi b/doc/lispref/sequences.texi index 188a3451140..327de6eb86a 100644 --- a/doc/lispref/sequences.texi +++ b/doc/lispref/sequences.texi | |||
| @@ -1355,7 +1355,7 @@ each initialized to @var{object}. | |||
| 1355 | @defun vconcat &rest sequences | 1355 | @defun vconcat &rest sequences |
| 1356 | @cindex copying vectors | 1356 | @cindex copying vectors |
| 1357 | This function returns a new vector containing all the elements of | 1357 | This function returns a new vector containing all the elements of |
| 1358 | @var{sequences}. The arguments @var{sequences} may be true lists, | 1358 | @var{sequences}. The arguments @var{sequences} may be proper lists, |
| 1359 | vectors, strings or bool-vectors. If no @var{sequences} are given, | 1359 | vectors, strings or bool-vectors. If no @var{sequences} are given, |
| 1360 | the empty vector is returned. | 1360 | the empty vector is returned. |
| 1361 | 1361 | ||