diff options
| author | Gerd Moellmann | 1999-10-26 12:24:28 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 1999-10-26 12:24:28 +0000 |
| commit | a61b9217743f577b6d511b24e231362f3efd1c59 (patch) | |
| tree | b70ae44681b9f3113e49115faaa453b1d947f6a0 | |
| parent | d5c3f902bd12b08dbbcab84603b5b67cc17ff50e (diff) | |
| download | emacs-a61b9217743f577b6d511b24e231362f3efd1c59.tar.gz emacs-a61b9217743f577b6d511b24e231362f3efd1c59.zip | |
Patch from rms.
| -rw-r--r-- | lispref/objects.texi | 42 |
1 files changed, 29 insertions, 13 deletions
diff --git a/lispref/objects.texi b/lispref/objects.texi index 7a70f4417ac..1da82860262 100644 --- a/lispref/objects.texi +++ b/lispref/objects.texi | |||
| @@ -22,12 +22,12 @@ but not for ``the'' type of an object. | |||
| 22 | 22 | ||
| 23 | @cindex primitive type | 23 | @cindex primitive type |
| 24 | A few fundamental object types are built into Emacs. These, from | 24 | A few fundamental object types are built into Emacs. These, from |
| 25 | which all other types are constructed, are called @dfn{primitive | 25 | which all other types are constructed, are called @dfn{primitive types}. |
| 26 | types}. Each object belongs to one and only one primitive type. These | 26 | Each object belongs to one and only one primitive type. These types |
| 27 | types include @dfn{integer}, @dfn{float}, @dfn{cons}, @dfn{symbol}, | 27 | include @dfn{integer}, @dfn{float}, @dfn{cons}, @dfn{symbol}, |
| 28 | @dfn{string}, @dfn{vector}, @dfn{subr}, and @dfn{byte-code function}, plus | 28 | @dfn{string}, @dfn{vector}, @dfn{hash-table}, @dfn{subr}, and |
| 29 | several special types, such as @dfn{buffer}, that are related to | 29 | @dfn{byte-code function}, plus several special types, such as |
| 30 | editing. (@xref{Editing Types}.) | 30 | @dfn{buffer}, that are related to editing. (@xref{Editing Types}.) |
| 31 | 31 | ||
| 32 | Each primitive type has a corresponding Lisp function that checks | 32 | Each primitive type has a corresponding Lisp function that checks |
| 33 | whether an object is a member of that type. | 33 | whether an object is a member of that type. |
| @@ -470,6 +470,11 @@ reliably. In a given context, usually only one of these uses is | |||
| 470 | intended. But you can use one symbol in all of these ways, | 470 | intended. But you can use one symbol in all of these ways, |
| 471 | independently. | 471 | independently. |
| 472 | 472 | ||
| 473 | A symbol whose name starts with a colon (@samp{:}) is called a | ||
| 474 | @dfn{keyword symbol}. These symbols automatically act as constants, and | ||
| 475 | are normally used only by comparing an unknown symbol with a few | ||
| 476 | specific alternatives. | ||
| 477 | |||
| 473 | @cindex @samp{\} in symbols | 478 | @cindex @samp{\} in symbols |
| 474 | @cindex backslash in symbols | 479 | @cindex backslash in symbols |
| 475 | A symbol name can contain any characters whatever. Most symbol names | 480 | A symbol name can contain any characters whatever. Most symbol names |
| @@ -1697,7 +1702,7 @@ types. In most cases, it is more convenient to use type predicates than | |||
| 1697 | This function returns a symbol naming the primitive type of | 1702 | This function returns a symbol naming the primitive type of |
| 1698 | @var{object}. The value is one of the symbols @code{symbol}, | 1703 | @var{object}. The value is one of the symbols @code{symbol}, |
| 1699 | @code{integer}, @code{float}, @code{string}, @code{cons}, @code{vector}, | 1704 | @code{integer}, @code{float}, @code{string}, @code{cons}, @code{vector}, |
| 1700 | @code{char-table}, @code{bool-vector}, @code{subr}, | 1705 | @code{char-table}, @code{bool-vector}, @code{hash-table}, @code{subr}, |
| 1701 | @code{compiled-function}, @code{marker}, @code{overlay}, @code{window}, | 1706 | @code{compiled-function}, @code{marker}, @code{overlay}, @code{window}, |
| 1702 | @code{buffer}, @code{frame}, @code{process}, or | 1707 | @code{buffer}, @code{frame}, @code{process}, or |
| 1703 | @code{window-configuration}. | 1708 | @code{window-configuration}. |
| @@ -1794,8 +1799,9 @@ Symbols}. | |||
| 1794 | This function returns @code{t} if @var{object1} and @var{object2} have | 1799 | This function returns @code{t} if @var{object1} and @var{object2} have |
| 1795 | equal components, @code{nil} otherwise. Whereas @code{eq} tests if its | 1800 | equal components, @code{nil} otherwise. Whereas @code{eq} tests if its |
| 1796 | arguments are the same object, @code{equal} looks inside nonidentical | 1801 | arguments are the same object, @code{equal} looks inside nonidentical |
| 1797 | arguments to see if their elements are the same. So, if two objects are | 1802 | arguments to see if their elements or contents are the same. So, if two |
| 1798 | @code{eq}, they are @code{equal}, but the converse is not always true. | 1803 | objects are @code{eq}, they are @code{equal}, but the converse is not |
| 1804 | always true. | ||
| 1799 | 1805 | ||
| 1800 | @example | 1806 | @example |
| 1801 | @group | 1807 | @group |
| @@ -1858,9 +1864,19 @@ contents are entirely @sc{ascii} (@pxref{Text Representations}). | |||
| 1858 | @end group | 1864 | @end group |
| 1859 | @end example | 1865 | @end example |
| 1860 | 1866 | ||
| 1861 | Two distinct buffers are never @code{equal}, even if their contents | 1867 | However, two distinct buffers are never considered @code{equal}, even if |
| 1862 | are the same. | 1868 | their textual contents are the same. |
| 1863 | @end defun | 1869 | @end defun |
| 1864 | 1870 | ||
| 1865 | The test for equality is implemented recursively, and circular lists may | 1871 | The test for equality is implemented recursively; for example, given |
| 1866 | therefore cause infinite recursion (leading to an error). | 1872 | two cons cells @var{x} and @var{y}, @code{(equal @var{x} @var{y})} |
| 1873 | returns @code{t} if and only if both the expressions below return | ||
| 1874 | @code{t}: | ||
| 1875 | |||
| 1876 | @example | ||
| 1877 | (equal (car @var{x}) (car @var{y})) | ||
| 1878 | (equal (cdr @var{x}) (cdr @var{y})) | ||
| 1879 | @end example | ||
| 1880 | |||
| 1881 | Because of this recursive method, circular lists may therefore cause | ||
| 1882 | infinite recursion (leading to an error). | ||