car (AutoLISP)

 
 
 

Returns the first element of a list

Supported Platforms: Windows and Mac OS

Signature

(car list)
list

Type: List

A list with one or more elements.

Return Values

Type: Integer, Real, String, List, T or nil

The first element in list; otherwise nil, if the list is empty.

Remarks

In AutoLISP, car is frequently used to obtain the X coordinate of a 2D or 3D point (the first element of a list of two or three reals).

Examples

(car '(a b c))
A

(car '((a b) c))
(A B)

(car '())
nil