All Manuals > LispWorks® User Guide and Reference Manual > 33 The COMMON-LISP Package

make-instance Generic Function

Summary

Creates and returns a new instance of a class.

Package

common-lisp

Signature

make-instance class &rest initargs &key &allow-other-keys => instance

Arguments
class
A class, or a symbol that names a class.
initargs
An initialization argument list.
Values
instance
A fresh instance of class class.
Description

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.

Notes

In a delivered image, make-instance does not check the initialization arguments.

Compatibility notes

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.

See also

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