Product Documentation
Cadence SKILL++ Object System Reference
Product Version IC23.1, June 2023

allocateInstance

allocateInstance( 
us_class 
) 
=> g_instance

Description

Creates and returns an empty instance of the specified class. All slots of the new instance are unbound.

Arguments

us_class

Class object or a symbol denoting a class object for which a new instance should be created.

Value Returned

g_instance

An empty instance of u_class.

Exampless

defclass(A () ((slot1 @initform 1) (slot2 @initform 2)))
i = allocateInstance(findClass('A))
i->??
=> (slot1 \*slotUnbound\* slot2 \*slotUnbound\*)
i = allocateInstance('A)
i->??
=> (slot1 \*slotUnbound\* slot2 \*slotUnbound\*)

Related Topics

Classes and Instances


Return to top
 ⠀
X