exists
exists(s_formalVarl_valueListg_predicateExpr) =>g_resultexists(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. 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
Tests an association table and verifies the existence of an entry where both the key and its corresponding value are of type string.
exists( x '(1 2 3 4) (x > 1) )
=> (2 3 4)
exists( x '(1 2 3 4) (x > 4) )
=> nil
exists( key myTable (and (stringp key)
(stringp myTable[key])))
=> t
Related Topics
Return to top