Syntax of LISP
The two fundamental pieces of LISP syntax are the idea of a list of things
and the dotted pair:
A dotted pair is the external image of a node in an internal data structure with two components called "car" and "cdr" for historical reasons. Each component in the pair points at an atomic item or another list.
Each list is coded internally as dotted pairs:
(A) = (A.NIL).
(A B) = (A.(B.NIL)).
(A B C ) = (A.(B.(C.NIL)) ).
(A B C D ... Y Z) = (A.(B.(C.(.D ... (Y. (Z. NIL)) ... ).
After the lexical analysis the interpreter parses input as a list_structure before evaluating it. A list_structure is empty, or a dotted_pair, or an atom, or any number of lists inside a pair of parenthesis. We often call a list structure a list for short. But always be careful to distinguishing 'a list of numbers' from a 'list structure of numbers'
Note. In old LISP, commas were optional separators in lists... but not in XLISP and Scheme. Note. The separating spaces, tabs, etc in a list are all sieved out by the lexical scan. This scan also removes comment lines that start with a semicolon [ comment in lisp.lexemes ]
Note: Syntax assumes that a lexical analysis process has already divided the input into lexemes and deleted any extra whitespace.
'global' variables are created by commands like 'setq' by the user. 'Local' variables are created in lambda_forms, definitions, LETs, PROGs,.... and deleted at the end of the expression or form.
. . . . . . . . . ( end of section Expressions) <<Contents | End>>
. . . . . . . . . ( end of section Syntax) <<Contents | End>>