Function Entry: ASSOC

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

Function Entry: ASSOC

Name

assoc

Class

Function

Syntax

(assoc item alist)

Arguments and Values

  • item: key to search for
  • alist: association list

Description

Searches an association list for a dotted pair whose first element matches item.

Return Values

Returns the matching dotted pair or nil.

Side Effects

None.

Examples

  • (assoc 'size '((name box) (width 3) (size 4.7263) (depth 5))) => (SIZE 4.7263)
  • (assoc 'weight '((name box) (width 3) (size 4.7263) (depth 5))) => nil

Compatibility

This is a central function in CAD database idioms because entity and table data are commonly represented as alists.

The dedicated Autodesk page describes item as an integer, real, or string, but its own examples also use symbols. This inconsistency should be kept visible and eventually tested.

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