Function Entry: NTH
← Prev | ↑ Chapter | Next → | Index | Symbols
Function Entry: NTH
Name
nth
Class
Function
Syntax
(nth n lst)
Arguments and Values
n: indexlst: 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.
Source Notes
- [nth (AutoLISP)](https://help.autodesk.com/cloudhelp/2016/ENU/AutoCAD-AutoLISP/files/GUID-0330FE17-6E15-4E34-BB50-E9040EABDADB.htm)
- Status: documented.