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

nthelem

nthelem( 
x_index1 
l_list 
) 
=> g_result / nil 

Description

Returns the indexed element of the list, assuming a one-based index.

Thus nthelem(1 l_list) is the same as car(l_list).

Arguments

x_index1

Index of the element of l_list you want returned.

l_list

List of elements.

Value Returned

g_result

The x_index1 element of l_list.

nil

If x_index1 is less than or equal to 0 or is greater than the length of the list.

Examples

nthelem( 1 '(a b c) )  
=> a
z = '(1 2 3)
nthelem(2 z)
=> 2

Related Topics

nth


Return to top
 ⠀
X