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

forall

forall(
s_formalVar
l_valueList
g_predicateExpr
)
=> t / nil
forall(
s_key
o_table
g_predicateExpr
)
=> t / nil

Description

Checks if g_predicateExpr evaluates to non-nil for every element in l_valueList. This is a syntax form.

Verifies that an expression remains true for every element in a list. The forall function can also be used to verify that an expression remains true for every key/value pair in an association table. The syntax for association table processing is provided in the second syntax statement.

Arguments

s_formalVar

Local variable usually referenced in g_predicateExpr.

l_valueList

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

g_predicateExpr

A SKILL expression that usually uses the value of s_formalVar.

s_key

Key portion of the table entry.

o_table

Association table containing the entries to be processed.

Value Returned

t

If g_predicateExpr evaluates to non-nil for every element in l_valueList or for every key in an association table.

nil

If g_predicateExpr evaluates to nil for every element in l_valueList or for every key in an association table.

Examples

Returns t if each key and its value in the association table are of the type string.

forall( x '(1 2 3 4) (x > 0) )
=> t
forall( x '(1 2 3 4) (x < 4) )
=> nil
forall(key myTable (and (stringp key)(stringp myTable[key])))
=> t

Related Topics

Flow Control Functions


Return to top
 ⠀
X