Creates and returns a new instance of a class.
common-lisp
make-instance class &rest initargs &key &allow-other-keys => instance
class⇩ |
A class, or a symbol that names a class. |
initargs⇩ |
An initialization argument list. |
instance |
A fresh instance of class class. |
The generic function make-instance
behaves as specified in ANSI Common Lisp, making an instance of class using the initargs initargs.
In particular it checks the initialization arguments as calculated by compute-class-potential-initargs.
This check can be suppressed by passing :allow-other-keys t
. In addition, LispWorks provides global control over the initarg checking via set-clos-initarg-checking and per-class control via class-extra-initargs.
In a delivered image, make-instance
does not check the initialization arguments.
In LispWorks 4.2 and previous versions, make-instance
does not check the initargs. If your code contains invalid initargs, you could use one of the techniques mentioned above to resolve it.
make-instance in the Common Lisp HyperSpec
class-extra-initargs
compute-class-potential-initargs
set-clos-initarg-checking
LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:30