Product Documentation
Cadence SKILL Language Reference
Product Version IC23.1, November 2023

addDefstructClass

addDefstructClass( 
s_name 
) 
=> u_classObject

Description

Creates a class for the defstruct.

By default, an instance of a defstruct does not have a class. You cannot use Instance to instantiate this class. Use the instantiation function created by defstruct.

Using addDefstructClass to create a class for a defstruct allows you to define methods for a defstruct.

Arguments

s_name

The name of the defstruct.

Value Returned

u_classObject

The class object.

Examples

defstruct( card rank suit ) 
=> t
x = _card( ?rank 8 ?suit "spades" )
=> array[4]:3897312
type( x )
=> card
findClass( 'card )
=> nil
classOf( x )
=> nil
addDefstructClass( card )
=> funobj:0x1c98f8
className( classOf( x ))
=> card

Related Topics

Function and Program Structure

Instance


Return to top
 ⠀
X