setofs
setofs(s_formalVarl_valueListg_predicateExpression) =>l_result
setofs( ( s_formalVar1... s_formalVarN )l_valueList1 ... l_valueListN g_predicateExpression) =>l_valueList/l_result
setofs(s_formalVaro_tableg_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
Value Returned
|
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)
procedure(SetofScopingIssue(x)
procedure(checkValue(candidate)
candidate==x
)
setofs(x '(1 2 3 4 5)
checkValue(x)
)
)
SetofScopingIssue(3) => (3)
Related Topics
Return to top