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
M-expression
(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!
==Background== [[John McCarthy (computer scientist)|John McCarthy]] published the first paper on Lisp in 1960 while a research fellow at the [[Massachusetts Institute of Technology]]. In it he described a language of symbolic expressions ([[S-expression]]s) that could represent complex structures as lists. Then he defined a set of primitive operations on the S-expressions, and a language of meta-expressions (M-expressions) that could be used to define more complex operations. Finally, he showed how the meta-language itself could be represented with S-expressions, resulting in a system that was potentially [[Self-hosting (compilers)|self-hosting]].<ref name="lisp1960">McCarthy, John (April 1960) "Recursive Functions of Symbolic Expressions and Their Computation by Machine, Part I"</ref> The draft version of this paper is known as "AI Memo 8".<ref>{{cite web |last1=McCarthy |first1=John |title=Recursive Functions of Symbolic Expressions and Their Computation by Machine (AI Memo 8) |url=https://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/aim-8/index.html |date=March 1959 |url-status=dead |archive-url=https://web.archive.org/web/20210307145003/https://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/aim-8/index.html |archive-date=7 March 2021 }}</ref> {| class="wikitable" |+ Example M-expressions (LISP 1.5, 1965)<ref name=LISP15/> ! Expression type ! Mathematical notation ! M-expression ! Modern Lisp S-expression |- | List value | <math>(1, 2, 3)</math> | {{code|(1, 2, 3)}} | {{code|2=lisp|(quote (1 2 3))}} |- | Function application | <math>f(x, y)</math> | {{code|f[x;y]}} | {{code|2=lisp|(f x y)}} |- | Function definition | <math>\mathrm{square}: x \mapsto x \cdot x</math> | {{code|1=label[square;Ξ»[[x];times[x;x]]]}} | {{code|2=lisp|(define square (lambda (x) (* x x)))}} |- | Conditional expression | <math>\begin{cases} -x, & \text{if } x < 0 \\ x, & \text{otherwise} \end{cases} </math> | {{code|[lessp[x;0] β minus[x]; T β x]}} | {{code|2=lisp|(cond ((< x 0) (- x)) (t x))}} |} McCarthy had planned to develop an automatic Lisp compiler ([[LISP 2]]) using M-expressions as the language syntax and S-expressions to describe the compiler's internal processes. [[Steve Russell (computer scientist)|Stephen B. Russell]] read the paper and suggested to him that S-expressions were a more convenient syntax. Although McCarthy disapproved of the idea, Russell and colleague Daniel J. Edwards hand-coded an [[Interpreter (computing)|interpreter]] program that could execute S-expressions.<ref name=LISP15>{{cite web |url=http://community.computerhistory.org/scc/projects/LISP/book/LISP%201.5%20Programmers%20Manual.pdf |date=1965|title=LISP 1.5 Programmer's Manual |publisher=Community.computerhistory.org |access-date=2013-09-02 |url-status=dead |archive-url=https://web.archive.org/web/20060211020233/http://community.computerhistory.org/scc/projects/LISP/book/LISP%201.5%20Programmers%20Manual.pdf |archive-date=2006-02-11 }}</ref> This program was adopted by McCarthy's research group, establishing S-expressions as the dominant form of Lisp. McCarthy reflected on the fate of M-expressions in 1979: {{quote|The project of defining M-expressions precisely and compiling them or at least translating them into S-expressions was neither finalized nor explicitly abandoned. It just receded into the indefinite future, and a new generation of programmers appeared who preferred internal notation to any FORTRAN-like or ALGOL-like notation that could be devised.<ref>{{cite web|url=http://www-formal.stanford.edu/jmc/history/lisp/node3.html |title=The implementation of LISP |publisher=Formal.stanford.edu |date=1979-02-12 |access-date=2013-08-24}}</ref>|''[http://www-formal.stanford.edu/jmc/history/lisp/lisp.html History of Lisp]''}} The book ''Anatomy of LISP'' by John Allen explains the definition of M-expressions and uses them throughout the book to explain Lisp and its implementation.<ref name=AOL>{{cite web |url=https://dl.acm.org/doi/10.5555/542865 |date=1978|title=Anatomy of LISP |publisher=McGraw-Hill, Inc.}}</ref>
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)