Function Entry: EVAL
← Prev | ↑ Chapter | Next → | Index | Symbols
Function Entry: EVAL
Name
eval
Class
Function
Syntax
(eval expr)
Arguments and Values
expr: any AutoLISP expression. Documented value types are integer, real, string, list, symbol, ename, T, or nil.
Description
Returns the result of evaluating an AutoLISP expression. eval is an ordinary function, so evaluation happens in two stages: the argument form is first evaluated by the normal call-argument machinery of the caller, and the resulting value is then evaluated a second time by eval. The pedagogical point of eval is precisely this second evaluation; it only does observable work when the first evaluation yields an unevaluated form (a symbol to resolve, or a list to evaluate as a call). When the first evaluation yields a self-evaluating value (a number, string, T, or nil), the second evaluation returns it unchanged and eval appears to do nothing.
Return Values
Returns the value produced by the second evaluation of expr. The return type follows the resulting form and is one of integer, real, string, list, ename, T, or nil.
Side Effects
Side effects are those of the evaluated expression.
Examples
Given (setq a 123) and (setq b 'a):
Self-evaluating edge case (the second evaluation has no work to do):
(eval 4.0)returns4.0.evalreceives4.0(the argument is already evaluated);4.0self-evaluates to4.0.
Significative cases (the first evaluation yields a form, so the second evaluation does real work):
(eval '(+ 1 2))returns3. The argument'(+ 1 2)evaluates to the list(+ 1 2);evalthen evaluates that list as a form, giving3.(eval (list '+ 'a b))returns246.(list '+ 'a b)evaluates to(+ A A)— because `'A A)yields the symbol+,'ayields the symbolA, andbyieldsA(its value, the symbola);evalthen evaluates(, andAis bound to123, giving246. Equivalent to(eval '(+ A A))`.(eval b)returns123. This is a two-step evaluation: the argumentbevaluates to the symbolA(since(setq b 'a)), andevalthen evaluates the symbolA, which is bound to123. Contrast(eval a), whose argumentaalready evaluates to123, a self-evaluating number, soevalreturns123without further work.
Availability
- AutoCAD 2026: documented.
- BricsCAD V26: presumed compatible (no contradicting page found).
- Status: AutoCAD documented; BricsCAD presumed-both pending Phase 4 verification.
Source Notes
- [eval (AutoLISP 2026)](https://help.autodesk.com/cloudhelp/2026/ENU/AutoCAD-AutoLISP-Reference/files/GUID-D9B3E6CC-A982-4040-AE6E-6FD63D6C54D0.htm)
- Status: documented (Phase 3 body fill).