Function Entry: VL-LIST-LENGTH

← Prev | ↑ Chapter | Next → | Index | Symbols

Function Entry: VL-LIST-LENGTH

Name

vl-list-length

Class

Visual LISP List Function

Syntax

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

Arguments and Values

  • list-or-cons-object: a true (proper) list, a dotted (improper) list, or nil.

Description

Returns the length of a true list. Unlike Common Lisp's length, which signals an error on a dotted list, vl-list-length returns nil for a dotted list, providing graceful handling of malformed list structures.

Return Values

An integer for proper lists; nil for dotted lists.

Side Effects

None.

Examples

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

Availability

  • AutoCAD 2026: documented.
  • BricsCAD V26: presumed compatible.
  • Status: AutoCAD documented; BricsCAD presumed-both pending Phase 4 verification.

Source Notes