Function Entry: SUBST

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

Function Entry: SUBST

Name

subst

Class

Function

Syntax

(subst new old expr)

Arguments and Values

  • new: replacement value
  • old: value to replace
  • expr: tree/list structure

Description

Substitutes new for occurrences of old within expr.

Return Values

Returns a copy of the list with new substituted for every occurrence of old.

If old is not found, Autodesk documents that the original list is returned unchanged.

Side Effects

None specified.

Examples

  • (subst 'qq 'b '(a b (c d) b)) => (A QQ (C D) QQ)
  • (subst '(qq rr) '(c d) '(a b (c d) b)) => (A B (QQ RR) B)

Compatibility

Exact structural sharing versus reconstruction behavior remains to be tightened from dedicated documentation or tests.

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.