summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/eieio-base.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2014-10-17 01:09:24 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2014-10-17 01:09:24 -0400
commit942501730f55719f1d3cda9f476e00f5c497259c (patch)
tree42395325d99dca1891b759881b7fe9b6b28e4382 /lisp/emacs-lisp/eieio-base.el
parent60727a5494698b4c6bfa24bab72f75bb7d07a755 (diff)
downloademacs-942501730f55719f1d3cda9f476e00f5c497259c.tar.gz
* lisp/emacs-lisp/eieio-base.el: Use lexical-binding and cl-lib.
* lisp/emacs-lisp/eieio-core.el: Use lexical-binding and cl-lib. (list-of): New type. (eieio--typep): Remove. (eieio-perform-slot-validation): Use cl-typep instead. * lisp/emacs-lisp/eieio.el: Use lexical-binding drop non-GV fallback. (defclass, defgeneric, defmethod): Add doc-string position. (with-slots): Require cl-lib. * lisp/emacs-lisp/cl-macs.el (cl--make-type-test): Avoid ((lambda ..) ..).
Diffstat (limited to 'lisp/emacs-lisp/eieio-base.el')
-rw-r--r--lisp/emacs-lisp/eieio-base.el11
1 files changed, 6 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/eieio-base.el b/lisp/emacs-lisp/eieio-base.el
index 150724e6484..a1c2cb54a9e 100644
--- a/lisp/emacs-lisp/eieio-base.el
+++ b/lisp/emacs-lisp/eieio-base.el
@@ -1,4 +1,4 @@
-;;; eieio-base.el --- Base classes for EIEIO.
+;;; eieio-base.el --- Base classes for EIEIO. -*- lexical-binding:t -*-
;;; Copyright (C) 2000-2002, 2004-2005, 2007-2014 Free Software
;;; Foundation, Inc.
@@ -31,7 +31,7 @@
;;; Code:
(require 'eieio)
-(eval-when-compile (require 'cl)) ;FIXME: Use cl-lib!
+(eval-when-compile (require 'cl-lib))
;;; eieio-instance-inheritor
;;
@@ -52,7 +52,8 @@ a parent instance. When a slot in the child is referenced, and has
not been set, use values from the parent."
:abstract t)
-(defmethod slot-unbound ((object eieio-instance-inheritor) class slot-name fn)
+(defmethod slot-unbound ((object eieio-instance-inheritor)
+ _class slot-name _fn)
"If a slot OBJECT in this CLASS is unbound, try to inherit, or throw a signal.
SLOT-NAME is the offending slot. FN is the function signaling the error."
(if (slot-boundp object 'parent-instance)
@@ -118,7 +119,7 @@ a variable symbol used to store a list of all instances."
:abstract t)
(defmethod initialize-instance :AFTER ((this eieio-instance-tracker)
- &rest slots)
+ &rest _slots)
"Make sure THIS is in our master list of this class.
Optional argument SLOTS are the initialization arguments."
;; Theoretically, this is never called twice for a given instance.
@@ -154,7 +155,7 @@ Multiple calls to `make-instance' will return this object."))
A singleton is a class which will only ever have one instance."
:abstract t)
-(defmethod constructor :STATIC ((class eieio-singleton) name &rest slots)
+(defmethod constructor :STATIC ((class eieio-singleton) _name &rest _slots)
"Constructor for singleton CLASS.
NAME and SLOTS initialize the new object.
This constructor guarantees that no matter how many you request,