This glossary contains definitions of terms related to programming in general and AutoLISP in particular.  However, it does not contain the various functions that make up the AutoLISP language (for that, see "Alphabetic list of functions" or "Catalog of functions".

A procedure, or set of steps in the solution of a problem.  This procedure can exist either in the abstract (as a verbal or graphic description of the steps), or in the concrete (as a set of expressions in a specific programming language).

American Standard Code for Information Interchange.  This is a widely adopted set of 128 characters and their associated code numbers (0 - 127).  It covers all the letters of the alphabet (separate codes for upper and lower case), numbers, punctuation marks, and various other characters related to computer files.  For example, the ASCII code for "A" is 65, "a" is 97, and "1" is 49.  The first 32 codes (0 - 31) are devoted to control characters.  For example, 7 is bell, 8 is backspace, 10 is line feed, 13 is carriage return, and 27 is escape,   The "Extended ASCII codes," (128 - 255) have various characters assigned to them, depending on the software setup (code 127 also varies).  If you need to know the ASCII code of a particular character, you can use the AutoLISP function ascii.  For example, (ascii "B") returns 66.  Or, you can check the list below.

32 space 
33    ! 
34   " 
35   # 
36   $ 
37   % 
38   & 
39   ' 
40   ( 
41   ) 
42   * 
43   + 
44   , 
45   - 
46   . 
47   /
48   0 
49   1 
50   2 
51   3 
52   4 
53   5 
54   6 
55   7 
56   8 
57   9 
58   : 
59   ; 
60   < 
61   = 
62   > 
63   ?
64   @ 
65   A 
66   B 
67   C 
68   D 
69   E 
70   F 
71   G 
72   H 
73   I 
74   J 
75   K 
76   L 
77   M 
78   N 
79   O
80   P 
81   Q 
82   R 
83   S 
84   T 
85   U 
86   V 
87   W 
88   X 
89   Y 
90   Z 
91   [ 
92   \ 
93   ] 
94   ^ 
95   _
  96   ` 
  97   a 
  98   b 
  99   c 
100   d 
101   e 
102   f 
103   g 
104   h 
105   i 
106   j 
107   k 
108   l 
109   m 
110   n 
111   o
112   p 
113   q 
114   r 
115   s 
116   t 
117   u 
118   v 
119   w 
120   x 
121   y 
122   z 
123   { 
124   | 
125   } 
126   ~ 
Association list
A list in which each of the top level elements is a list which has as its first element a key (index) element.  Here is an example of an association list in which the -1, 0, 5, 100, etc. are the key elements in the sublists:   ((-1 . <Entity name: 2550520>)  (0 . "CIRCLE")  (5 . "4C")  (100 . "AcDbEntity")  (67 . 0)  (8 . "0")  (100 . "AcDbCircle")  (10 2.0 4.0 0.0)  (40 . 0.5)  (210 0.0 0.0 1.0)).  Association lists are used in AutoLISP to hold information about drawing entities.

Individual items, as opposed to lists.  Atoms include such things as integers, real (floating point) numbers, symbols, and text strings.

An expression which tests for a certain condition, then does one thing if the condition is met, another thing if the condition is not met.  The two conditional functions in AutoLISP are cond and if.
Entity name
A hex number which points to a particular memory location holding information about an entity in the drawing.  As a drawing is loaded into memory, information on each entity is placed at specific locations in memory.  The AutoLISP functions entsel, entlast, entnext, and ssget can retrieve an entity's name.  The entity name can then be used to retrieve the entire association list describing that entity.  If other entities are deleted from the drawing database and the drawing is then saved and reloaded, some entities will be placed in memory locations that are different than where they were previously placed.  Thus, an entity's name changes from one editing session to the next.  In contrast, an entity's handle remains the same across all editing sessions.
This symbol can be used to redefine AutoLISP's built-in error routine.  When the built-in error routine is in effect, any error which occurs in a program (including the user's hitting the esc key) causes (1) the name of the error to be displayed on screen, and (2) the offending function and its arguments, plus several levels of surrounding functions, to be dumped to screen.  When *error* is defined, that definition (defun) takes the place of the built-in error routine, so the programmer can control the effect of various errors.
Floating point number
Refers to a real number.  See "Real number" below.
A basic programming command.  A function is to AutoLISP as a command is to DOS or to AutoCAD.  Most functions take arguments, which have to be in a certain order and of a certain type.  In AutoLISP, the function always comes first in the list (it is the first element inside the opening parenthesis) and it tells the AutoLISP interpreter what to do with all the other elements in the program expression.  Sample AutoLISP functions would include:  math functions such as + and *, trig functions such as sin and atan, string functions such as strcat and substr, as well as the ubiquitous functions setq and defun.  For example, in the expression (*  45.0  3), the "*" is the function which multiplies the numbers following it.  In the expression (setq  n1  500), the "setq" is the function which assigns the number 500 to the variable n1.
Global variable
A variable is global if it retains its value after the function or program which uses it is done executing.  Compare "Local variable" below.
A whole number.  All the "counting" numbers are integers, plus zero and negative whole numbers.  An integer does not have any decimal part.  The following are integers:  -3, 0, and 651.  The following are not integers:  1.0, -2.0, 0.0.  Compare "Real number" below.
A term that programmers like to use, which simply means repetition.

The letters "LISP" are an acronym in which the "LIS" stands for list, and the "P" stands for processing.  LISP is an old programming language which existed long before AutoCAD.  The dialect called XLISP is the language from which AutoLISP was developed for inclusion in AutoCAD.  For a full explanation of AutoLISP, see "Basic concepts" and "History of AutoLISP".
An expression consisting of any number of elements between parentheses.  Here are three sample lists:  (setq  var1  45), (strcat  "hello"  " dolly"), and (456.76  32.06  180.25).  In a function list (such as the first two samples), a function is the first element in the list.  In a data list (such as the third sample), there is no function within the list, but every element in the list (or the list as a whole) is acted upon by an external function.  A list can be a null list (containing nothing) or contain many elements.  Lists can also contain other lists, which in turn can also contain other lists.  In other words, lists can be nested many levels deep, as in the following example:  (setq  sum  (+  n1  n2  (*  (sqrt 10)  n3)))
Local variable
A variable is local to a particular function or program if it retains its value only while that function or program is executing.  Local variables are defined in the second argument of the defun function by listing them after a forward slash in the variable list.  For example, the following expression defines a function called func1 which accepts variables aa and bb, and makes variables cc and dd local:  (defun func1 (aa bb / cc dd) . . .)   Compare "Global variable" above.
Usually a short program written to automate several steps.  Macros are found in many types of software, such as database, spreadsheet, and word processing.  They often consist of a list of several operations saved in a file under a certain name which can be called from within the program.  When called by a single word or even a single letter, the entire file of operations is executed.  (Thus, batch files could be considered macros.)  Macros can be used in AutoCAD in scripts and in menus.  There are some who might call AutoLISP a macro language, but AutoLISP's capabilities go way beyond that of macros.

A pre-assigned symbol whose meaning varies depending on the contest.  You might say that nil means nothing, or false, or not assigned.  If the question concerns truth (true or false?) nil indicates false.  If the question is whether or not a symbol or variable is assigned (or bound to) a value, nil indicates that it is not.  Nil is not zero because zero is a numeric value.  Nil is not a null string ("") because a null string is still a string.

Order of operations
This is sometimes called precedence of operations.  It refers to the order in which various operations are carried out.  This concept is more significant in a system of notation which uses algebraic notation rather than prefix notation.  In algebraic notation, several operations are listed one after the other, but certain of those operations will be performed before others in spite of the order in which they are listed.  For example, multiplication will be done before addition or subtraction.  However, AutoLISP, since it uses prefix notation, has only one operation per list.  And the order in which the lists are evaluated is always from the inside out.  So, on the one hand, rules about order of operations have little meaning in AutoLISP.  On the other hand, when converting a formula from algebraic notation to AutoLISP, an awareness of the order of operations is imperative.

Pre-assigned symbols
Symbols (variables) which have default values assigned, which you should not change.  Pre-assigned symbols include:  T  =  true, non-nil;  nil  =  nil;  pi  =  3.1415926535...;  pause  =  used in the command function to allow for user input.  Warning: Do not assign any of these symbols any different values.
A function that returns either true (T) or false (nil).  Many predicate functions end with "p" (e.g.: listp and zerop).

Prefix notation
Prefix notation is the type of notation used in AutoLISP.  The two common types of notation used in the fields of mathematics & programming are (1) algebraic notation, and (2) prefix notation.  In algebraic notation the function (or procedure) comes between arguments.  For example, in the algebraic expression a+b+c, the three arguments (a, b, and c) are separated by the addition functions.  In prefix notation the function (or procedure) comes first.  Thus in the AutoLISP expression (+ a b c), the three arguments (a, b, and c) follow the addition function.

A built-in function; one that is supplied with AutoLISP, such as setq, defun, or getpoint.

A program is simply a set of functions, executed in a certain order.  AutoLISP programs are written in plain ASCII text files, then loaded into memory inside AutoCAD for execution at the Command prompt or from a menu pick.  Programs can be as simple as a few lines long, or as complex as hundreds of pages long.
A unit of measure for angles.  One radian is the angle subtended by an arc that has a curved length equal to the radius of the arc.  In other words, if you start with a circle, then take a line that has the same length as the radius of that circle and bend it around the circle's circumference, it will encompass an angle of one radian.  Since pi (3.1415926535...) represents the ratio of a circle's circumference to its diameter, and its circumference encompasses 360°, pi also represents the ratio of a semicircle (180°) to its radius.  Therefore, 180° equals pi radians.  So, to convert radians to degrees, multiply radians by 57.29578 or (180/pi).  To convert degrees to radians, multiply degrees by 0.017453293 or (pi/180).
Real number
A number which has a decimal portion, even if that decimal portion is zero.  Real numbers are also called floating point numbers.  The phrase "real number" is often shortened to "real."  The following are real numbers:  2.25,  41.00,  -4.5,  3.1416, and 0.000.  Even a number that has a decimal point but nothing following the decimal point (such as 18.) is considered a real.  Even though the field of mathematics uses other types of numbers, AutoLISP uses only integers and reals.  Some AutoLISP functions always return reals (such as getreal and distance), others always return integers (such as getint and strlen).  Compare "Integer" above.
Syntax applies to functions and the way functions are used in program expressions.  The syntax describes the form that the program expression must take when it uses that function.  Syntax can also be thought of as the rules for writing a program expression, or the structure of a program expression.  Here, for example, is the syntax of the substr (substring) function:  {This function takes three arguments in the following form:  (substr  argument1  argument2  argument3).  Argument1 is a string.  Argument2 is an integer indicating how far into the string to begin extracting the substring.  Argument3 is optional and is an integer indicating how long the substring will be.}  By describing what arguments are used with the function, the order of the arguments, and how those arguments work, we have described the function's syntax.

System variable
A variable used by AutoCAD to store information about current settings.  For example, if you have just used the FILLET command and set the radius to .375, the system variable called "filletrad" holds that value and it shows up in the default the next time you use FILLET.  AutoCAD uses many system variables to store everything from the current drawing name to the size of dimension arrows to the current running osnap mode.  You will find a complete list of system variables in AutoCAD's Command Reference.  In AutoLISP, the values in system variables are retrieved with the getvar function, and set with the setvar function.

A pre-assigned symbol meaning true, or non-nil.
Top level elements
A list can contain both atoms and sublists.  When considering a certain list, each atom or sublist that it contains is called a top level element.  But any elements (atoms or other sublists) contained in those top level sublists are considered second level elements.  For example, in the following list, even though there are 10 numbers, there are only three top level elements:  (1.00  (2.00 3.00 (4.00 5.00 (6.00 7.00 8.00)) 9.00) 10.00)   The three top level elements are: (1) 1.00, (2) the list which begins with 2.00 and ends with 9.00 and contains sublists, and (3) 10.00.  It is the top level elements which are counted by the length function.
A procedure used in debugging programs which involves the display of certain aspects of the program (such as the name of the current subroutine, values in variables, etc.) while the program is running.  In AutoLISP, only the name of the current subroutine is displayed and the values it receives and returns.  Tracing is turned on and off with the trace and untrace functions.

A symbol that can hold different values at different times.  For example, the variable var1 might hold 55.25 one time a program is run, -32.7 the next time, and different numbers other times.  Program variables are much like the unknowns in a formula, such as the L and W in this formula:  Area = L x W.  In programs, however, variables often hold different values at different times within the same program.  A variable can be contrasted with a constant.  A constant might be the number 150, but a variable might be the symbol dis (short for distance) which can hold 150 or any other number.  Besides holding numbers, variables often hold strings, lists, etc.  See also "Local variable," "Global variable," and System variable" above.


Copyright © 1988, 1998 Ronald W. Leigh