aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorStefan Monnier2017-03-15 22:48:28 -0400
committerLars Brinkhoff2017-04-04 08:23:46 +0200
commit8e6f204f44b6183ba73c7d1bec5841f2b7b8bdd0 (patch)
tree31f4a44bb5bc70144a0a7194b266f1e30fce3b9e /doc
parent056548283884d61b1b9637c3e56855ce3a17274d (diff)
downloademacs-8e6f204f44b6183ba73c7d1bec5841f2b7b8bdd0.tar.gz
emacs-8e6f204f44b6183ba73c7d1bec5841f2b7b8bdd0.zip
Make EIEIO use records.
* lisp/emacs-lisp/eieio-compat.el (eieio--generic-static-object-generalizer): Adjust to new tags. * lisp/emacs-lisp/eieio-core.el: Use records, and place the class object directly as tag. (eieio--object-class): Adjust to new tag representation. (eieio-object-p): Rewrite, and adapt to new `type-of' behavior. (eieio-defclass-internal): Use `make-record'. (eieio--generic-generalizer): Adjust generalizer code accordingly. * lisp/emacs-lisp/eieio.el (make-instance, clone): Use copy-record. * lisp/emacs-lisp/pcase.el (pcase-mutually-exclusive-predicates): Add `recordp'. * doc/lispref/records.texi, doc/misc/eieio.texi: Update for records.
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/records.texi3
-rw-r--r--doc/misc/eieio.texi8
2 files changed, 6 insertions, 5 deletions
diff --git a/doc/lispref/records.texi b/doc/lispref/records.texi
index 618f30a72ce..822fd2bf36e 100644
--- a/doc/lispref/records.texi
+++ b/doc/lispref/records.texi
@@ -9,7 +9,8 @@
9 9
10 The purpose of records is to allow programmers to create objects 10 The purpose of records is to allow programmers to create objects
11with new types that are not built into Emacs. They are used as the 11with new types that are not built into Emacs. They are used as the
12underlying representation of @code{cl-defstruct} instances. 12underlying representation of @code{cl-defstruct} and @code{defclass}
13instances.
13 14
14 Internally, a record object is much like a vector; its slots can be 15 Internally, a record object is much like a vector; its slots can be
15accessed using @code{aref}. However, the first slot is used to hold 16accessed using @code{aref}. However, the first slot is used to hold
diff --git a/doc/misc/eieio.texi b/doc/misc/eieio.texi
index dfae565deed..7076c244222 100644
--- a/doc/misc/eieio.texi
+++ b/doc/misc/eieio.texi
@@ -1017,7 +1017,7 @@ If @var{errorp} is non-@code{nil}, @code{wrong-argument-type} is signaled.
1017 1017
1018@defun class-p class 1018@defun class-p class
1019@anchor{class-p} 1019@anchor{class-p}
1020Return @code{t} if @var{class} is a valid class vector. 1020Return @code{t} if @var{class} is a valid class object.
1021@var{class} is a symbol. 1021@var{class} is a symbol.
1022@end defun 1022@end defun
1023 1023
@@ -1055,7 +1055,7 @@ Will fetch the documentation string for @code{eieio-default-superclass}.
1055Return a string of the form @samp{#<object-class myobjname>} for @var{obj}. 1055Return a string of the form @samp{#<object-class myobjname>} for @var{obj}.
1056This should look like Lisp symbols from other parts of Emacs such as 1056This should look like Lisp symbols from other parts of Emacs such as
1057buffers and processes, and is shorter and cleaner than printing the 1057buffers and processes, and is shorter and cleaner than printing the
1058object's vector. It is more useful to use @code{object-print} to get 1058object's record. It is more useful to use @code{object-print} to get
1059and object's print form, as this allows the object to add extra display 1059and object's print form, as this allows the object to add extra display
1060information into the symbol. 1060information into the symbol.
1061@end defun 1061@end defun
@@ -1212,7 +1212,7 @@ items defined in this second slot.
1212 1212
1213Introspection permits a programmer to peek at the contents of a class 1213Introspection permits a programmer to peek at the contents of a class
1214without any previous knowledge of that class. While @eieio{} implements 1214without any previous knowledge of that class. While @eieio{} implements
1215objects on top of vectors, and thus everything is technically visible, 1215objects on top of records, and thus everything is technically visible,
1216some functions have been provided. None of these functions are a part 1216some functions have been provided. None of these functions are a part
1217of CLOS. 1217of CLOS.
1218 1218
@@ -1525,7 +1525,7 @@ Currently, the default superclass is defined as follows:
1525 nil 1525 nil
1526 "Default parent class for classes with no specified parent class. 1526 "Default parent class for classes with no specified parent class.
1527Its slots are automatically adopted by classes with no specified 1527Its slots are automatically adopted by classes with no specified
1528parents. This class is not stored in the `parent' slot of a class vector." 1528parents. This class is not stored in the `parent' slot of a class object."
1529 :abstract t) 1529 :abstract t)
1530@end example 1530@end example
1531 1531