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

setof

setof( 
s_formalVar 
l_valueList 
g_predicateExpression 
)
=> l_result
setof( 
( s_formalVar1... s_formalVarN ) 
l_valueList1 ... l_valueListN
g_predicateExpression
)
=> l_valueList / l_result
setof( 
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. 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

setof( x '(1 2 3 4) (x > 2) )    
=> (3 4)
setof( x '(1 2 3 4) (x < 3) )    
=> (1 2)
setof( (x y) '(1 2 3) '(4 5 6)  oddp(x) && evenp(y)) 
=> (1 3)
myTable = makeTable("atable" 0)  
=> table:atable
myTable["a"]="first"             
=> "first"
myTable["b"]=2                   
=> 2
setof(key myTable (and (stringp key)(stringp myTable[key])))
=> ("a")

Related Topics

Flow Control Functions


Return to top
 ⠀
X