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

eq

eq( 
g_arg1 
g_arg2 
) 
=> t / nil

Description

Checks addresses when testing for equality.

Returns t if g_arg1 and g_arg2 are the same (that is, are at the same address in memory). The eq function runs considerably faster than equal but should only be used for testing equality of symbols, shared lists, or small numeric values (in the range of -256 to +256). Using eq on types other than symbols, lists, or small numeric values will give unpredictable results and should be avoided.
For testing equality of numbers, strings, and lists in general, the equal function and not the eq function should be used. You can test for equality between symbols using eq more efficiently than using the == operator, which is the same as the equal function. If one argument of the eq function is a string, SKILL Lint prints an error suggesting that the eqv or equal function be used instead.

Arguments

g_arg1

Any SKILL object. g_arg1 is compared with g_arg2 to see if they point to the same object.

g_arg2

Any SKILL object.

Value Returned

t

Both arguments are the same object.

nil

The two objects are not identical.

Examples

x = 'dog 
eq( x 'dog )
=> t
eq( x 'cat )        
=> nil
y = 'dog 
eq( x y )  
=> t

Related Topics

Logical and Relational Functions

equal


Return to top
 ⠀
X