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

setofs

setofs( 
s_formalVar 
l_valueList 
g_predicateExpression 
)
=> l_result
setofs( 
( s_formalVar1... s_formalVarN ) 
l_valueList1 ... l_valueListN
g_predicateExpression
)
=> l_valueList / l_result
setofs( 
s_formalVar 
o_table 
g_predicateExpression 
)
=> l_result

Description

Returns a new list containing only those elements in a list or the keys in an association table that satisfy an expression. In the SKILL++ mode, this function always locally wraps the loop or iterator local variable (s_formalVar) in a let block while compiling the code. Local wrapping preserves the lexical scope of the loop variable. This function may work slower than its non-wrapped counterpart setof. This is a syntax form.

The setof form can also be used to identify all keys in an association table that satisfy the specified expression.

Arguments

s_formalVar

s_formalVar1...s_formalVarN

Local variable that is usually referenced in g_predicateExpression.

l_valueList

l_valueList1...l_valueListN

List of elements that are bound to s_formalVar one at a time.

g_predicateExpression

SKILL expression that usually uses the value of s_formalVar.

o_table

Association table whose keys are bound to s_formalVar one at time.

Value Returned

l_result

New list containing only those elements in l_valueList that satisfy g_predicateExpression, or list of all keys that satisfy the specified expression.

Examples

procedure(SetofScopingIssue(x)
procedure(checkValue(candidate)
candidate==x
)
setof(x '(1 2 3 4 5)
checkValue(x)
)
)
SetofScopingIssue(3) => (1 2 3 4 5)

Whereas using setofs:

procedure(SetofScopingIssue(x)
procedure(checkValue(candidate)
candidate==x
)
setofs(x '(1 2 3 4 5)
checkValue(x)
)
)
SetofScopingIssue(3) => (3)

Related Topics

Flow Control Functions


Return to top
 ⠀
X