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 valuelst-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.
Source Notes
- [cons (AutoLISP)](https://help.autodesk.com/cloudhelp/2026/FRA/AutoCAD-AutoLISP-Reference/files/GUID-33B418E7-DB3D-4CBE-954E-F070F0A7CB2B.htm)
- Status: documented.