Function Entry: LOAD

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

Function Entry: LOAD

Name

load

Class

Function

Syntax

(load filename [onfailure])

Arguments and Values

  • filename: source or compiled Lisp file designator
  • onfailure: optional failure-handling argument

Description

Loads an AutoLISP or compatible file into the current environment.

Return Values

If loading succeeds, Autodesk documents the return value as unspecified.

If loading fails:

  • the value of onfailure is returned if that argument is supplied,
  • if onfailure is a valid AutoLISP function, it is evaluated,
  • if onfailure is omitted, an AutoLISP error is signaled.

Side Effects

  • reads and evaluates forms from the target file
  • may establish functions, variables, and other definitions

Affected By

  • search path rules
  • trusted-path rules
  • environment profile
  • file encoding rules
  • filename extension search rules

Exceptional Situations

File and load errors are host- and version-sensitive.

Compatibility

Autodesk documents the extension search order used when filename has no extension:

  1. .vlx
  2. .fas
  3. .lsp

As soon as a match is found, loading stops and that file is loaded.

Notes

Autodesk also documents that VLX support is Windows-only.

In clautolisp, load is gated by the trust model: at SECURELOAD 2 a source/executable file in an untrusted location is blocked (ERRNO 73 and a :load-untrusted-file error, or the onfailure value when supplied), at 1 it warns and proceeds, and a trusted file is always allowed. The user init files the engine auto-loads (~/.autolisp and its XDG variants) are trusted by exact path unless --no-init is given. Relative names are resolved through the support search path. See Normative Rules: Secure File Loading and Trust Model (this chapter).

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.