A tree representation typically represented with parentheses.
When representing source code in Lisp, the first element of an S-expression is commonly an operator or function name and any remaining elements are treated as arguments.
- Lists and pairs:
(1 () (2 . 3) (4)) - Symbols:
with-hyphen?@!$|a symbol with spaces| - Strings:
"Hello, world!" - Integers:
-9876543210 - Floating-point numbers:
-0.06.283186.022e23
Example
(defun factorial (x)
(if (zerop x)
1
(* x (factorial (- x 1)))))
incoming: i-expressions