Sets the value of a quoted symbol name to an expression
Supported Platforms: Windows and Mac OS
(set sym expr)
Type: Symbol
The user-defined variable to assign expr to.
Type: Integer, Real, String, List, Symbol, File, Ename (entity name), T, or nil
An AutoLISP expression.
Type: Integer, Real, String, List, Symbol, File, Ename (entity name), T, or nil
The value of the expression.
The set function is similar to setq except that set evaluates both of its arguments whereas setq only evaluates its second argument.
Each of the following commands sets symbol a to 5.0:
(set 'a 5.0) 5.0 (set (read "a") 5.0) 5.0 (setq a 5.0) 5.0
Both set and setq expect a symbol as their first argument, but set accepts an expression that returns a symbol, whereas setq does not, as the following shows:
(set (read "a") 5.0) 5.0 (setq (read "a") 5.0) ; *** ERROR: syntax error