Function Entry: =
← Prev | ↑ Chapter | Next → | Index | Symbols
Function Entry: =
Name
=
Class
Function
Syntax
(= expr [expr ...])
Arguments and Values
- one or more expressions of any type (see "The Comparison Operators" above).
Description
Compares its arguments for equality, each with the one to its right. Numbers compare by value across the integer/real tower ((= 1 1.0) => T); strings compare by content, case-sensitively ((= "abc" "abc") => T, (= "a" "A") => nil); any other pair compares by identity, as eq does ((= 'a 'a) => T, (= nil nil) => T).
Return Values
- T if every adjacent pair compares equal, or with a single argument
- nil otherwise
Side Effects
Side effects are those of evaluating the argument expressions.
Examples
- `(= 1 1)
> T1 1.0) => T`;( - `(= "abc" "abc")
> T"a" "A") => nil`;( - `(= 1 1 1)
> T1 1 2) => nil`;( (= 1 "1") => nil— unequal, no error.- `(= 'a 'a)
> Tnil nil);(> T(list 1) (list 1)) => nil`;( - `(= 'a)
> T)` signals an error (too few arguments).;(
Compatibility
Unlike eq, numbers and strings compare by value/content; unlike equal, lists compare by identity. Never signals a type error. See "The Comparison Operators , /, <, <=, >, >=" and "Function Entry: EQ" / "Function Entry: EQUAL".
Availability
- AutoCAD 2022: measured (comparison-operators probe, 2026-09-25).
- BricsCAD V25 / V26: measured, identical to AutoCAD.
- Status: verified on both vendors.
Source Notes
- [Non-alphabetic Functions Reference (AutoLISP)](https://help.autodesk.com/cloudhelp/2026/KOR/AutoCAD-LT-AutoLISP-Reference/files/GUID-EBDC1072-48BF-4204-80B1-73430DBF58E1.htm)
- [Equality and Conditional Functions Reference (AutoLISP)](https://help.autodesk.com/cloudhelp/2023/ENU/AutoCAD-AutoLISP-Reference/files/GUID-C6A7FC58-7A07-4650-9D59-12CAFD194FDA.htm)
- Probe:
autolisp-front-end/tests/scenarios/language/comparison-operators-probe.lsp.