Function Entry: NTH

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

Function Entry: NTH

Name

nth

Class

Function

Syntax

(nth n lst)

Arguments and Values

  • n: index
  • lst: list

Description

Returns the element at index n in lst.

Return Values

Element at the specified position, or nil if n is greater than the highest element number of the list.

Side Effects

None.

Examples

  • (nth 3 '(a b c d e)) => D
  • (nth 0 '(a b c d e)) => A
  • (nth 5 '(a b c d e)) => nil

Compatibility

Autodesk explicitly documents zero-based indexing for nth.

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.