About Symbols and Variables (AutoLISP)

AutoLISP uses symbols to refer to functions and data holders.

Symbol names are not case sensitive and may consist of any sequence of alphanumeric and notation characters, except the following:

Characters restricted from symbol names

(

(Open Parenthesis)

)

(Close Parenthesis)

.

(Period)

'

(Apostrophe)

"

(Quote Symbol)

;

(Semicolon)

A symbol name cannot consist only of numeric characters.

Technically, AutoLISP applications consist of either symbols or constant values, such as strings, reals, and integers. For the sake of clarity, this documentation uses the term symbol to refer to a symbol name that stores static data, such as built-in and user-defined functions. Examples of symbols are, the predefined variable T and the defun function.

The term variable is used to refer to a symbol name that stores program data. The following example uses the setq function to assign the string value "this is a string" to the str1 variable:

(setq str1 "this is a string")
"this is a string"
Note: When declaring variables or defining a function, choose meaningful names to make it easy to identify the type of data a variable holds or the purpose of a function.