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

throw

throw(
s_tag
g_value
) 
=> 

Description

Transfers the control back to the return point established in a catch block. The argument value is used as the value to be passed. The throw function should always be used inside catch(. . . g_form . . .).

Arguments

s_tag

Specifies the return point in a catch block

g_value

Evaluates forms and saves the results. If the form produces multiple values, then all the values are saved. The saved results are returned as the value or values of catch.

Value Returned

Transfers the control back to the return point in a catch block

Examples

catch( 'problem
    begin(
     throw( 'problem
let( nil
printf( "Caught %L\n" 1) 1
)
    )
2
)
)
Caught 1  ;  message is printed . . .

=> 1  ;  value returned by throw()


Return to top
 ⠀
X