Function: make-instance

make-instance is an autoloaded and byte-compiled function defined in eieio.el.gz.

Signature

(make-instance CLASS &rest INITARGS)

Documentation

Make a new instance of CLASS based on INITARGS.

For example:

  (make-instance 'foo)

INITARGS is a property list with keywords based on the :initarg for each slot. For example:

  (make-instance 'foo :slot1 value1 :slotN valueN)

Probably introduced at or before Emacs version 25.1.

Aliases

constructor (obsolete since 25.1)

Implementations

(make-instance (THIS (subclass semantic-collector-buffer-abstract)) &rest ARGS) in `semantic/complete.el'.

Reuse previously created objects of this type in buffer.

(make-instance (CLASS (subclass eieio-named)) &rest ARGS) in `eieio-base.el'.

Undocumented

(make-instance (CLASS (subclass eieio-singleton)) &rest SLOTS) in `eieio-base.el'.

Constructor for singleton CLASS. NAME and SLOTS initialize the new object. This constructor guarantees that no matter how many you request, only one object ever exists.

(make-instance (CLASS (subclass eieio-default-superclass)) &rest SLOTS) in `eieio.el'.

Default constructor for CLASS `eieio-default-superclass'. SLOTS are the initialization slots used by `initialize-instance'. This static method is called when an object is constructed. It allocates the vector used to represent an EIEIO object, and then calls `initialize-instance' on that object.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/eieio.el.gz
;;;###autoload
(cl-defgeneric make-instance (class &rest initargs)
  "Make a new instance of CLASS based on INITARGS.
For example:

  (make-instance \\='foo)

INITARGS is a property list with keywords based on the `:initarg'
for each slot.  For example:

  (make-instance \\='foo :slot1 value1 :slotN valueN)")