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
Value Returned
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
Return to top