diff options
| -rw-r--r-- | doc/misc/ChangeLog | 8 | ||||
| -rw-r--r-- | doc/misc/eieio.texi | 98 |
2 files changed, 38 insertions, 68 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 3866b2dc7a8..c0a47b4db8d 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2014-01-22 David Engster <deng@randomsample.de> | ||
| 2 | |||
| 3 | * eieio.texi (Introduction): Move introductory paragraph about | ||
| 4 | EIEIO and CLOS from 'Building Classes' to here. | ||
| 5 | (Documentation): Remove, since eieio-doc is not part of Emacs. | ||
| 6 | (Class Values, CLOS compatibility): Mention that | ||
| 7 | `describe-function' will also give information about classes. | ||
| 8 | |||
| 1 | 2014-01-20 Paul Eggert <eggert@cs.ucla.edu> | 9 | 2014-01-20 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 10 | ||
| 3 | * texinfo.tex: Update from gnulib. | 11 | * texinfo.tex: Update from gnulib. |
diff --git a/doc/misc/eieio.texi b/doc/misc/eieio.texi index 427c10c160e..370d18cc567 100644 --- a/doc/misc/eieio.texi +++ b/doc/misc/eieio.texi | |||
| @@ -72,7 +72,6 @@ framework for writing object-oriented applications in Emacs. | |||
| 72 | * Base Classes:: Additional classes you can inherit from. | 72 | * Base Classes:: Additional classes you can inherit from. |
| 73 | * Browsing:: Browsing your class lists. | 73 | * Browsing:: Browsing your class lists. |
| 74 | * Class Values:: Displaying information about a class or object. | 74 | * Class Values:: Displaying information about a class or object. |
| 75 | * Documentation:: Automatically creating texinfo documentation. | ||
| 76 | * Default Superclass:: The root superclasses. | 75 | * Default Superclass:: The root superclasses. |
| 77 | * Signals:: When you make errors. | 76 | * Signals:: When you make errors. |
| 78 | * Naming Conventions:: Name your objects in an Emacs friendly way. | 77 | * Naming Conventions:: Name your objects in an Emacs friendly way. |
| @@ -177,9 +176,17 @@ error. @ref{Signals}. | |||
| 177 | @node Introduction | 176 | @node Introduction |
| 178 | @chapter Introduction | 177 | @chapter Introduction |
| 179 | 178 | ||
| 180 | Due to restrictions in the Emacs Lisp language, CLOS cannot be | 179 | First off, please note that this manual cannot serve as a complete |
| 181 | completely supported, and a few functions have been added in place of | 180 | introduction to object oriented programming and generic functions in |
| 182 | setf. | 181 | LISP. Although EIEIO is not a complete implementation of the Common |
| 182 | Lisp Object System (CLOS) and also differs from it in several aspects, | ||
| 183 | it follows the same basic concepts. Therefore, it is highly | ||
| 184 | recommended to learn those from a textbook or tutorial first, | ||
| 185 | especially if you only know OOP from languages like C++ or Java. If | ||
| 186 | on the other hand you are already familiar with CLOS, you should be | ||
| 187 | aware that @eieio{} does not implement the full CLOS specification and | ||
| 188 | also differs in some other aspects (@xref{Introduction}, and @ref{CLOS | ||
| 189 | compatibility}). | ||
| 183 | 190 | ||
| 184 | @eieio{} supports the following features: | 191 | @eieio{} supports the following features: |
| 185 | 192 | ||
| @@ -211,7 +218,10 @@ Public and private classifications for slots (extensions to CLOS) | |||
| 211 | Customization support in a class (extension to CLOS) | 218 | Customization support in a class (extension to CLOS) |
| 212 | @end enumerate | 219 | @end enumerate |
| 213 | 220 | ||
| 214 | Here are some important CLOS features that @eieio{} presently lacks: | 221 | Due to restrictions in the Emacs Lisp language, CLOS cannot be |
| 222 | completely supported, and a few functions have been added in place of | ||
| 223 | setf. Here are some important CLOS features that @eieio{} presently | ||
| 224 | lacks: | ||
| 215 | 225 | ||
| 216 | @table @asis | 226 | @table @asis |
| 217 | 227 | ||
| @@ -247,17 +257,6 @@ should use a deep copy but currently does not. | |||
| 247 | @node Building Classes | 257 | @node Building Classes |
| 248 | @chapter Building Classes | 258 | @chapter Building Classes |
| 249 | 259 | ||
| 250 | First off, please note that this manual cannot serve as a complete | ||
| 251 | introduction to object oriented programming and generic functions in | ||
| 252 | LISP. Although EIEIO is not a complete CLOS implementation and also | ||
| 253 | differs from CLOS in several aspects, it follows the same basic | ||
| 254 | concepts. Therefore, it is highly recommended to learn these from a | ||
| 255 | textbook or tutorial first, especially if you only know OOP from | ||
| 256 | languages like C++ or Java. If on the other hand you are already | ||
| 257 | familiar with CLOS, you should be aware that @eieio{} does not implement | ||
| 258 | the full CLOS specification and also differs in some other aspects | ||
| 259 | (@xref{Introduction}, and @ref{CLOS compatibility}). | ||
| 260 | |||
| 261 | A @dfn{class} is a definition for organizing data and methods | 260 | A @dfn{class} is a definition for organizing data and methods |
| 262 | together. An @eieio{} class has structures similar to the classes | 261 | together. An @eieio{} class has structures similar to the classes |
| 263 | found in other object-oriented (OO) languages. | 262 | found in other object-oriented (OO) languages. |
| @@ -1546,55 +1545,18 @@ comes out upside-down. | |||
| 1546 | @chapter Class Values | 1545 | @chapter Class Values |
| 1547 | 1546 | ||
| 1548 | Details about any class or object can be retrieved using the function | 1547 | Details about any class or object can be retrieved using the function |
| 1549 | @code{eieio-describe-class}. Interactively, type in the name of | 1548 | @code{eieio-describe-class}. Interactively, type in the name of a |
| 1550 | a class. In a program, pass it a string with the name of a class, a | 1549 | class. In a program, pass it a string with the name of a class, a |
| 1551 | class symbol, or an object. The resulting buffer will display all slot | 1550 | class symbol, or an object. The resulting buffer will display all |
| 1552 | names. | 1551 | slot names. Additionally, all methods defined to have functionality |
| 1553 | 1552 | on this class is displayed. | |
| 1554 | Additionally, all methods defined to have functionality on this class is | 1553 | |
| 1555 | displayed. | 1554 | You can also use the normal @code{describe-function} to retrieve |
| 1556 | 1555 | information about a class. If you call it on a constructor function, | |
| 1557 | @node Documentation | 1556 | it will also display the class information. If you call it on a |
| 1558 | @chapter Documentation | 1557 | generic function, all implementations of that generic function will be |
| 1559 | 1558 | listet, together with links through which you can directly jump to the | |
| 1560 | It is possible to automatically create documentation for your classes in | 1559 | source. |
| 1561 | texinfo format by using the tools in the file @file{eieio-doc.el} | ||
| 1562 | |||
| 1563 | @deffn Command eieiodoc-class class indexstring &optional skiplist | ||
| 1564 | |||
| 1565 | This will start at the current point, and create an indented menu of | ||
| 1566 | all the child classes of, and including @var{class}, but skipping any | ||
| 1567 | classes that might be in @var{skiplist}. It will then create nodes for | ||
| 1568 | all these classes, subsection headings, and indexes. | ||
| 1569 | |||
| 1570 | Each class will be indexed using the texinfo labeled index | ||
| 1571 | @var{indexstring} which is a two letter description. | ||
| 1572 | @xref{New Indices,,,texinfo,Texinfo manual}. | ||
| 1573 | |||
| 1574 | To use this command, the texinfo macro | ||
| 1575 | |||
| 1576 | @example | ||
| 1577 | @@defindex @@var @{ indexstring @} | ||
| 1578 | @end example | ||
| 1579 | |||
| 1580 | @noindent | ||
| 1581 | where @var{indexstring} is replaced with the two letter code. | ||
| 1582 | |||
| 1583 | Next, an inheritance tree will be created listing all parents of that | ||
| 1584 | section's class. | ||
| 1585 | |||
| 1586 | Then, all the slots will be expanded in tables, and described | ||
| 1587 | using the documentation strings from the code. Default values will also | ||
| 1588 | be displayed. Only those slots with @code{:initarg} specified will be | ||
| 1589 | expanded, others will be hidden. If a slot is inherited from a parent, | ||
| 1590 | that slot will also be skipped unless the default value is different. | ||
| 1591 | If there is a change, then the documentation part of the slot will be | ||
| 1592 | replace with an @@xref back to the parent. | ||
| 1593 | |||
| 1594 | This command can only display documentation for classes whose | ||
| 1595 | definitions have been loaded in this Emacs session. | ||
| 1596 | |||
| 1597 | @end deffn | ||
| 1598 | 1560 | ||
| 1599 | @node Default Superclass | 1561 | @node Default Superclass |
| 1600 | @chapter Default Superclass | 1562 | @chapter Default Superclass |
| @@ -1903,9 +1865,9 @@ work. | |||
| 1903 | @end table | 1865 | @end table |
| 1904 | 1866 | ||
| 1905 | CLOS supports the @code{describe} command, but @eieio{} only provides | 1867 | CLOS supports the @code{describe} command, but @eieio{} only provides |
| 1906 | @code{eieio-describe-class}, and @code{eieio-describe-generic}. These | 1868 | @code{eieio-describe-class}, and @code{eieio-describe-generic}. Those |
| 1907 | functions are adviced into @code{describe-variable}, and | 1869 | are automatically called by @code{describe-function} when called on a |
| 1908 | @code{describe-function}. | 1870 | constructor or generic function. |
| 1909 | 1871 | ||
| 1910 | When creating a new class (@pxref{Building Classes}) there are several | 1872 | When creating a new class (@pxref{Building Classes}) there are several |
| 1911 | new keywords supported by @eieio{}. | 1873 | new keywords supported by @eieio{}. |