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

equal

equal( 
g_arg1 
g_arg2 
) 
=> t / nil

Description

Checks contents of strings and lists when testing for equality.

Checks if two arguments are equal or if they are logically equivalent, for example, g_arg1 and g_arg2 are equal if they are both lists/strings and their contents are the same. This test is slower than using eq but works for comparing objects other than symbols.

Arguments

g_arg1

Any SKILL object. g_arg1 and g_arg2 are tested to see if they are logically equivalent.

g_arg2

Any SKILL object.

Value Returned

t

If g_arg1 and g_arg2 are equal.

nil

If g_arg1 and g_arg2 are not equal.

Examples

x = 'cat 
equal( x 'cat )
=> t
x == 'dog          
=> nil   ; == is the same as equal.
x = "world" 
equal( x "world" )
=> t
x = '(a b c) 
equal( x '(a b c))
=> t
equal(2 2.0)       
=> t

Related Topics

Logical and Relational Functions

eq


Return to top
 ⠀
X