Function Entry: >

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

Function Entry: >

Name

>

Class

Function

Syntax

(> expr [expr ...])

Arguments and Values

  • one or more expressions; with two or more, each adjacent pair must be two numbers, two strings, or include nil (shared rules above).

Description

Returns T if each argument is greater than the argument to its right — numbers by value, strings lexicographically by character code point, with nil below every other value. The pairs are compared left to right and the result is nil at the first pair that does not hold.

Return Values

  • T if every adjacent pair holds, or with a single argument
  • nil at the first pair that does not hold

Side Effects

Side effects are those of evaluating the arguments.

Examples

  • (> 3 2 1) => T
  • (> "c" "b" "a") => T
  • (> "a" nil) => T ; (> nil 1) => nil — nil is the smallest value, never an error.
  • (> 1 "a") signals a type error, as does a symbol or a list.
  • (> 'a) => T — one argument is not checked; (>) signals an error (too few arguments).

Compatibility

See "The Comparison Operators , /, <, <=, >, >=" for the shared rules and the vendor divergence.

Availability

  • AutoCAD 2022: measured (comparison-operators probe, 2026-09-25).
  • BricsCAD V25 / V26: measured; differs from AutoCAD on the rows listed under clautolisp below.
  • Status: verified on both vendors.

Source Notes

clautolisp

clautolisp implementation deviation — not part of the normative specification above. Divergence case 2 (resolved: AutoCAD adopted). The vendors differ on:

  • (> nil 1 "a"): AutoCAD nil (normative), BricsCAD type error.

Under --autocad, --clautolisp and --lax clautolisp gives AutoCAD's answer silently. Under --dialect bricscad it signals the type error, as BricsCAD does, and emits a [comparison-divergence] portability warning; under --strict it gives AutoCAD's answer and also warns. A comparison of two arguments never diverges except (>= x nil) with x neither a number nor a string. Implemented in clautolisp/autolisp-builtins-core/source/api.lisp (RELATIONAL-ORDER-P); see issues/closed/comparison-operators-vendor-semantics.issue.