makeInstance
makeInstance(us_class[ u_?initArg1value1] [ u_?initArg2value2] ... ) =>g_instance
Description
Creates an instance of a class, which can be given as a symbol or a class object.
Arguments
Value Returned
|
The instance. The print representation of the instance resembles |
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
Return to top