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

begin

SKILL mode
begin( 
g_exp1 
[ g_exp2 ... 
g_expN ] 
) 
=> g_result
SKILL++ mode
begin( 
 def1 
 [ def2 ... 
  defN ] 
) 
=> g_result

Description

In the SKILL mode, begin is a syntax form used to group a sequence of expressions. Evaluates expressions from left to right and returns the value of the last expression. Equivalent to progn. This expression type is used to sequence side effects such as input and output. Whereas, in the SKILL++ mode, begin is a syntax form used to group either a sequence of expressions or a sequence of definitions.

begin( exp1 [exp2 ... expN] )

The expressions are evaluated sequentially from left to right, and the value of the last expression is returned. This expression type is used to sequence side effects such as input and output.

begin( [def1 def2 ... defN] )

This form is treated as though the set of definitions is given directly in the enclosing context. It is most commonly found in macro definitions.

Arguments

g_exp1, g_exp2, g_expN

Arbitrary expressions.

Value Returned

g_result

Value of the last expression, g_expN.

Examples

The following example describes the begin function in the SKILL mode.

begin( x = 1 y = 2 z = 3 )
=> 3

The following example describes the begin function in the SKILL++ mode.

begin( x = 1 y = 2 z = 3 ) 
=> 3
begin( define( x 1 ) define( y 2 ) define( z 3 ) )
=> z

Related Topics

Function and Program Structure

progn


Return to top
 ⠀
X