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

labels

labels( 
l_bindings 
[ g_body ] 
) 
=> g_result

Description

Enables you to define local functions with LET semantics.

labels is similar to the flet function except that in labels, the scope of name bindings for the functions defined by labels encompasses the function body as well as the function definitions themselves.

labels can only be used in Scheme mode.

Arguments

l_bindings

A list of variables or a list of the form (s_variable g_value).

g_body

A sequence of one or more expressions.

Value Returned

g_result

Result of evaluation.

Examples

(labels ((sum (x)
         (if (plusp x)
              x + (sum (sub1 x))
              0)))
         (sum 10))
=> 55

Related Topics

Function and Program Structure


Return to top
 ⠀
X