Lisp (programming language): Difference between revisions

Content deleted Content added
m +lang links: de, eo, fr, pl
*link fixes
Line 16:
Lisp is an expression-oriented language. Unlike most other languages, no distinction is made between "expressions" and "statements"; all code and data are written as expressions. When an expression is ''evaluated'', it produces a value (or list of values), which then can be embedded into other expressions.
 
McCarthy's 1958 paper introduced two types of syntax: [[S-expressionsexpression]]s (Symbolic Expressions), which are also called sexp's, and [[M-expressionsexpression]]s (Meta Expressions), which express functions of S-expressions. M-expressions never found favour, and almost all Lisps today use S-expressions to manipulate both code and data. The heavy use of parentheses in S-expressions has been criticized - one joke acronym for Lisp is "Lots of Irritating Superfluous Parenthesis" - but the S-expression syntax is also responsible for much of Lisp's power: the syntax is extremely regular, which facilitates manipulation by computer.
 
The reliance on expressions gives Lisp great flexibility. Because Lisp [[function (programming)|functions]] are themselves written as lists, they can be processed exactly like data - Lisp programs can be written to manipulate other Lisp programs. This is known as [[metaprogramming]]. Many Lisp dialects exploit this feature using [[macro]] systems, which make it possible to extend the language almost without limit.