It is looking for LM:STRINGSUBST, how does it know to look for this? What makes it look for LM:STRINGSUBST? Is it in the way the list is structured?

It is the position of the symbol 'LM:STRINGSUBST' in the code that informs the interpreter (the facility that turns the code into 'machine language' so to speak) to look for a function defined as 'LM:STRINGSUBST'. When a symbol is placed immediately after an opening bracket, it is interpreted as a function to be evaluated.

Because '+' is a AutoLisp functions that adds but LM:STRINGSUBST is nothing, I can change the spelling and it will look for different spelling too AC:NEWSPELLING

In the same way that we give other symbols meaning when we assign variables:

`(setq x 1)`

The symbol 'x' is arbitrary, and could very well be renamed to 'y', however, this is irrelevant since it is merely a symbol to help us structure the code. From the above expression we know that 'x' is a variable holding a value of 1, hence we might use in the following way:

`(1+ x)`

However, consider that the symbol 'x' could very well be a defined as a function instead. We could have defined it as follows:

`(defun x ( a ) (+ a 3))`

In which case the symbol 'x' is now a function that adds three to the supplied argument. Now, of course, if we attempt to use the symbol 'x' in our previous expression we receive an error:

`_$ (defun x ( a ) (+ a 3))`

X

_$ (1+ X)

; error: bad argument type: numberp: #<USUBR @13df96f4 X>

Because the function '1+' was expecting a numerical argument, not a function. Used as a function, however:

`_$ (x 5)`

8

Note that this is because the symbol 'x' points to a user defined subroutine (USUBR), and hence this subroutine is evaluated when 'x' is used as a function.

If we tried to use another symbol in place of 'x', say 'y', we receive the following error:

`_$ (y 5)`

; error: no function definition: Y

Since the symbol 'y' has no value at this point.

OK, so I realise that this post isn't as structured as it could be, and hopefully you can glean more from Se7en's document to help with your understanding; but the point I am attempting to make is that the symbols we use for variables and functions are merely aids for the construction of a program, they are arbitrary - it is the value they point to which is relevant:

`_$ (setq a 1 b "CAD" c 1+ d (eval (defun x ( a ) (+ a 3))) e 1.2 f '(1 2 3))`

_$ (type a)

INT

_$ (type b)

STR

_$ (type c)

SUBR

_$ (type d)

USUBR

_$ (type e)

REAL

_$ (type f)

LIST

I hope this helps with your understanding, if you still have questions, please do ask.

Lee