existss
existss(s_formalVarl_valueListg_predicateExpr) =>g_resultexistss(s_keyo_tableg_predicateExpr) =>t/nil
Description
Returns the first tail of l_valueList whose car satisfies a predicate expression. Also verifies whether an entry in an association table satisfies a predicate 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 exists. This is a syntax form.
This process continues to apply the cdr function successively through l_valueList until it finds a list element that causes g_predicateExpr to evaluate to non-nil. It then returns the tail that contains that list element as its first element.
This function can also be used to verify whether an entry in an association table satisfies g_predicateExpr.
Arguments
|
Local variable that is usually referenced in g_predicateExpr. |
|
|
List of elements that are bound to s_formalVar, one at a time. |
|
|
SKILL expression that usually uses the value of s_formalVar. |
|
Value Returned
|
First tail of l_valueList whose |
|
Examples
(defun test_exists (x) existss( x (list x x+1 x+9) println(x)) println(x) )
test_exists(9)
Also, see the example for the foreachs function.
Related Topics
Return to top