In computer programming, an S-expression (or symbolic expression, abbreviated as sexpr or sexp) is an expression in a like-named notation for nested list (tree-structured) data. S-expressions were invented for and popularized by the programming language Lisp, which uses them for source code as well as data.
In the usual parenthesized syntax of Lisp, an S-expression is classically defined as:
- an atom [Atom], or
- an expression of the form
(x . y)
wherex
andy
are S-expressions.[formatting added] (“S-Expression” 2022)
Tree data structure representing the s-expression
(* 2 (+ 3 4))
.
Bibliography
“S-Expression.” 2022. Wikipedia, February. https://en.wikipedia.org/w/index.php?title=S-expression&oldid=1070385728.