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

or

or( 
g_arg1 
g_arg2 
[ g_arg3... ] 
) 
=> nil / g_val

Description

Evaluates from left to right its arguments to see if the result is non-nil. As soon as an argument evaluates to non-nil, or returns that value without evaluating the rest of the arguments. If all arguments except the last evaluate to nil, or returns the value of the last argument as the result of the function call. Prefix form of the || binary operator.

Arguments

g_arg1

First argument to be evaluated.

g_arg2

Second argument to be evaluated.

g_arg3

Optional additional arguments to be evaluated.

Value Returned

nil

All arguments evaluate to nil.

g_val

Value of the argument that evaluates to non-nil, or the value of the last argument if all the preceding arguments evaluate to nil.

Examples

or(t nil) 
=> t
or(nil t) 
=> t
or(18 12) 
=> 18

Related Topics

Logical and Relational Functions

and


Return to top
 ⠀
X