Function Entry: CONS

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

Function Entry: CONS

Name

cons

Class

Function

Syntax

(cons new-first-element lst-or-atom)

Arguments and Values

  • new-first-element: any value
  • lst-or-atom: list or atom

Description

Adds an element to the beginning of a list, or constructs a dotted pair.

Return Values

  • a proper list if the second argument is a list
  • a dotted pair if the second argument is an atom

Side Effects

None.

Examples

  • (cons 'a '(b c)) => (A B C)
  • (cons '(a) '(b c d)) => ((A) B C D)
  • (cons 'a 2) => (A . 2)

Compatibility

This entry is central for understanding the list-versus-dotted-pair model of AutoLISP data.

Availability

  • AutoCAD 2026: documented (per Autodesk reference page).
  • BricsCAD V26: presumed compatible (no contradicting page found).
  • Status: AutoCAD documented; BricsCAD presumed-both pending Phase 4 verification.