User Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

cl:functions:make-instance [2019/11/11 05:00]
cl:functions:make-instance [2019/11/11 22:00] (current)
Line 1: Line 1:
 +====== Standard Generic Function MAKE-INSTANCE ======
 +
 +====Syntax====
 +  * **make-instance** //class ''&​rest''​ initargs ''&​key''​ ''&​allow-other-keys''//​ → //​instance//​
 +
 +====Method Signatures====
 +  * **make-instance** (//class// **[[CL:​Types:​standard-class]]**) //''&​rest''​ initargs//
 +  * **make-instance** (//class// **[[CL:​Types:​symbol]]**) //''&​rest''​ initargs//
 +
 +====Arguments and Values====
 +  * //class// - a //​[[CL:​Glossary:​class]]//,​ or a //​[[CL:​Glossary:​symbol]]//​ that names a //​[[CL:​Glossary:​class]]//​.
 +  * //​initargs//​ - an //​[[CL:​Glossary:​initialization argument list]]//.
 +  * //​instance//​ - a //​[[CL:​Glossary:​fresh]]//​ //​[[CL:​Glossary:​instance]]//​ of //​[[CL:​Glossary:​class]]//​ //class//.
 +
 +====Description====
 +The //​[[CL:​Glossary:​generic function]]//​ **make-instance** creates and returns a new //​[[CL:​Glossary:​instance]]//​ of the given //class//.
 +
 +If the second of the above //​[[CL:​Glossary:​method|methods]]//​ is selected, that //​[[CL:​Glossary:​method]]//​ invokes **make-instance** on the arguments ''​([[CL:​Functions:​find-class]] //​class//​)''​ and //​initargs//​.
 +
 +The initialization arguments are checked within **make-instance**.
 +
 +The //​[[CL:​Glossary:​generic function]]//​ **make-instance** may be used as described in \secref\ObjectCreationAndInit.
 +
 +====Affected By====
 +None.
 +
 +====Exceptional Situations====
 +If any of the initialization arguments has not been declared as valid, an error of type **[[CL:​Types:​error]]** is signaled.
 +
 +====See Also====
 +  * **[[CL:​Macros:​defclass|Macro DEFCLASS]]**
 +  * **[[CL:​Functions:​class-of|Function CLASS-OF]]**
 +  * **[[CL:​Functions:​allocate-instance|Generic Function ALLOCATE-INSTANCE]]**
 +  * **[[CL:​Functions:​initialize-instance|Generic Function INITIALIZE-INSTANCE]]**
 +  * {\secref\ObjectCreationAndInit}
 +
 +====Notes====
 +None.
 +
 +\issue{INITIALIZATION-FUNCTION-KEYWORD-CHECKING}