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

makeInstance

makeInstance( 
us_class 
[ u_?initArg1    value1 ]
[ u_?initArg2    value2 ] ... 
)
=> g_instance

Description

Creates an instance of a class, which can be given as a symbol or a class object.

Arguments

us_class

Class object or a symbol denoting a class object. The class must be a subclass of standardObject.

u_?initArg1 value1 u_?initArg2 value2

The symbol u_initArg1 is specified in one of the slot specifiers in the defclass declaration of either us_class or a superclass of us_class. value1 is the initial value for that slot. Similarly for the pair u_initArg2 value2 and so forth.

Value Returned

g_instance

The instance. The print representation of the instance resembles stdobj:xxxxx, where xxxxx is a hexadecimal number.

Examples

defclass( Circle ( GeometricObject ) 
(( center @initarg c ) ( radius @initarg r )) ) => t
P = makeInstance( 'Point ?name "P" ?x 3 ?y 4 )
=> stdobj:0x1d003c
C = makeInstance( 'Circle ?c P ?r 5.0 ) => stdobj:0x1d0048
makeInstance( 'fixnum )
*Error* unknown: non-instantiable class - fixnum
i3=makeInstance('standardObject) 
*Error* unknown: non-instantiable class - standardObject

Related Topics

Classes and Instances

defclass


Return to top
 ⠀
X