vl-list-length (AutoLISP)

Calculates list length of a true list

Supported Platforms: Windows and Mac OS

Signature

(vl-list-length list-or-cons-object)
list-or-cons-object

Type: List or nil

A true or dotted list.

Return Values

Type: Integer or nil

An integer containing the list length if the argument is a true list; otherwise nil if list-or-cons-object is a dotted list.

Compatibility note: The vl-list-length function returns nil for a dotted list, while the corresponding Common LISP function issues an error message if the argument is a dotted list.

Examples

(vl-list-length nil)
0

(vl-list-length '(1 2))
2

(vl-list-length '(1 2 . 3))
nil