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

slotUnbound

slotUnbound( 
u_class 
g_object 
s_slotName 
)
=> g_result

Description

This function is called when the slotValue function attempts to reference an unbound slot. It signals that the value of the slot s_slotName of g_object has not been set yet. In this case, slotValue returns the result of the method.

Arguments

u_class

A class object. The class must be either standardObject or a subclass of standardObject.

g_object

An instance of u_class.

s_slotName

The name of the unbound slot.

Value Returned

g_value

Value contained in the slot s_slotName. The default value is '\*slotUnbound\*.

Examples

defclass( A () ((a)))
=> t
x = (makeInstance 'A)
=> stdobj@0x83bf018
defmethod( slotUnbound (class (obj A) slotName) (printf "slotUnbound : slot '%L'is unbound\n" slotName) (setSlotValue obj slotName 6)
)
=> t
x->a
=> slotUnbound : slot 'a' is unbound
=> 6
x->a
=> 6
defmethod( slotUnbound (class (obj A) slotName) (printf "slotUnbound : slot '%L' is unbound\n" slotName) (setSlotValue obj slotName 6)
8
)
=> t
*WARNING* (defmethod): method redefined generic:slotUnbound class:(t A t)
x->a = '\*slotUnbound\*
\*slotUnbound\*
x->a
=> slotUnbound : slot 'a' is unbound
=> 8 ;; the return value of slotUnbound method, not a new value of the slot  
x->a
=> 6

Related Topics

Classes and Instances


Return to top
 ⠀
X