Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Lisp (programming language)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Symbolic expressions (S-expressions)=== Lisp is an [[expression oriented language]]. Unlike most other languages, no distinction is made between "expressions" and [[Statement (programming)|"statements"]];{{dubious|date=April 2013}}<!-- (progn ...), (setq ...). There is no syntactic distinction, but sequential evaluation is there. --> all code and data are written as expressions. When an expression is ''evaluated'', it produces a value (possibly multiple values), which can then be embedded into other expressions. Each value can be any data type. McCarthy's 1958 paper introduced two types of syntax: ''Symbolic expressions'' ([[S-expression]]s, sexps), which mirror the internal representation of code and data; and ''Meta expressions'' ([[M-expression]]s), which express functions of S-expressions. M-expressions never found favor, and almost all Lisps today use S-expressions to manipulate both code and data. The use of parentheses is Lisp's most immediately obvious difference from other programming language families. As a result, students have long given Lisp nicknames such as ''Lost In Stupid Parentheses'', or ''Lots of Irritating Superfluous Parentheses''.<ref name="LEVIN2">{{cite web |title=The Jargon File - Lisp |url=http://www.catb.org/~esr/jargon/html/L/LISP.html |access-date=2006-10-13}}</ref><!-- Add NO more nicknames. People can check the Jargon File for them. --> However, the S-expression syntax is also responsible for much of Lisp's power: the syntax is simple and consistent, which facilitates manipulation by computer. However, the syntax of Lisp is not limited to traditional parentheses notation. It can be extended to include alternative notations. For example, XMLisp is a Common Lisp extension that employs the [[Metaobject#Metaobject protocol|metaobject protocol]] to integrate S-expressions with the Extensible Markup Language ([[XML]]). The reliance on expressions gives the language great flexibility. Because Lisp [[function (programming)|functions]] are written as lists, they can be processed exactly like data. This allows easy writing of programs which manipulate other programs ([[metaprogramming]]). Many Lisp dialects exploit this feature using macro systems, which enables extension of the language almost without limit.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)