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

car

car( 
l_list 
) 
=> g_result

Description

Returns the first element of a list. car is nondestructive, meaning that it returns the first element of a list but does not modify the list that was its argument.

The functions car and cdr are typically used to take a list of objects apart, whereas the cons function is usually used to build up a list of objects. car was a machine language instruction on the first machine to run Lisp. car stands for contents of the address register.

Arguments

l_list

A list of elements.

Value Returned

g_result

The first element in a list.

Examples

car( '(a b c) )      
=> a
z = '(1 2 3)
=> (1 2 3)
y = car(z)
=> 1
y
=> 1
z
=> (1 2 3)
car(nil)
=> nil

Related Topics

cdr

cons


Return to top
 ⠀
X