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

defstructp

defstructp( 
g_object 
[ S_name ] 
) 
=> t / nil

Description

Checks if an object is an instance of a particular defstruct.

If the optional second argument is given, it is used as the defstruct name to check against. The suffix p is usually added to the name of a function to indicate that it is a predicate function.

Arguments

g_object

A data object.

S_name

Name of the structure to be tested for.

Value Returned

t

If g_object is an instance of defstruct S_name.

nil

The object is not an instance of the defstruct.

Examples

defstruct(myStruct slot1 slot2 slot3) 
=> t
struct = _myStruct(?slot1 "one" ?slot2 "two" ?slot3 "three")
=> array[5]:3555552
defstructp( "myDefstruct") 
=> nil
defstructp(struct 'myStruct)
=> t

Related Topics

defstruct

printstruct


Return to top
 ⠀
X