<div class="document" id="original-lisp"
     title="The Original LISP"
     description="AIM-8, The Original LISP"
     author="Pascal J. Bourguignon"
     keywords="LISP, Common Lisp, AIM-8, John McCarthy"
     language="en">

  <h1>The original LISP</h1>
  <p>Here is an implementation of the Original LISP as documented in
  <QUOTE><PRE class="text">
                                  March 4, 1959

    Artificial Intelligence Project--RLE and MIT Computation Center

                           Memo 8

    RECURSIVE FUNCTIONS OF SYMBOLIC EXPRESSIONS AND THEIR COMPUTATION

                         BY MACHINE

                       by J. McCarthy
   </PRE></QUOTE>
<ul>
<li><a href="aim-8.html">A transcription into machine readable form
                        (HTML and text)</a></li>
<li><a href="ftp://publications.ai.mit.edu/ai-publications/pdf/AIM-008.pdf">
      AI Memo 8, AIM-008.pdf</a></li>
<li><a href="http://www.ai.mit.edu/research/publications/browse/0000browse.shtml">
      CSAIL Digital Archive - Artificial Intelligence Laboratory Series,
      Publications 0 through 99</a></li>
<li><a href="http://www-formal.stanford.edu/jmc/history/lisp/lisp.html">
    History of Lisp</a> by John McCarthy</li>
</ul></P>

  <p>The only symbols predefined are: DEFINE, LAMBDA, LABEL, COND, COMBINE,
FIRST, REST, NULL, ATOM, EQ, NIL, T, and QUOTE. </p>

  <p>The file <A HREF="aim-8.lisp">aim-8.lisp</A>
     contains an implementation in Common-Lisp.</p>
  <p>The file <A HREF="aim-8.aim-8">aim-8.aim-8</A>
     contains an implementation in AIM-8 LISP.</p>
  <p>The file <A HREF="examples.aim-8">examples.aim-8</A>
     contains the other examples given in AIM-8: differential
     and turing machine.</p>

  <p>(It should be  noted that "compiler" occurs 4  times in this Memo,
      while "interpreter" doesn't appears.)</p>


   <p>For more information about Lisp history, see the
     <a href="http://community.computerhistory.org/scc/projects/LISP/">
         Computer History Museum, History of Lisp</a></p>

   <h2>Exemple</h2>

<pre class="dribble">
% <b>/usr/local/bin/clisp -norc -ansi </b>
  i i i i i i i       ooooo    o        ooooooo   ooooo   ooooo
  I I I I I I I      8     8   8           8     8     o  8    8
  I  \ `+' /  I      8         8           8     8        8    8
   \  `-+-'  /       8         8           8      ooooo   8oooo
    `-__|__-'        8         8           8           8  8
        |            8     o   8           8     o     8  8
  ------+------       ooooo    8oooooo  ooo8ooo   ooooo   8

Copyright (c) Bruno Haible, Michael Stoll 1992, 1993
Copyright (c) Bruno Haible, Marcus Daniels 1994-1997
Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998
Copyright (c) Bruno Haible, Sam Steingold 1999-2000
Copyright (c) Sam Steingold, Bruno Haible 2001-2006

[1]&gt; <b>(load (compile-file "aim-8.lisp"))</b>
;; Compiling file /local/users/pjb/src/public/small-cl-pgms/aim-8/aim-8.lisp ...
;; Wrote file /local/users/pjb/src/public/small-cl-pgms/aim-8/aim-8.fas
0 errors, 0 warnings
;; Loading file /local/users/pjb/src/public/small-cl-pgms/aim-8/aim-8.fas ...
;; Loaded file /local/users/pjb/src/public/small-cl-pgms/aim-8/aim-8.fas
T
[2]&gt; <b>(aim-8:repl)</b>
You've got:
    LAMBDA LABEL
    COND AND OR NOT  COMBINE FIRST REST
    NULL ATOM EQ NIL T QUOTE
Extensions:
    DEFINE RELOAD DUMP-ENVIRONMENT LOAD
    QUIT
AIM-8&gt; <b>(define maplist
           (lambda (x f)
             (cond ((null x) nil)
                   (t        (combine (f x) (maplist (rest x) f))))))</b>
MAPLIST
AIM-8&gt; <b>(define diff
           (lambda (y x)
             (cond
               ((atom y)
                (cond ((eq y x) (quote one))
                      (t (quote zero))))
               ((eq (first y) (quote plus))
                (combine (quote plus)
                         (maplist (rest y) (lambda (a) (diff (first a) x)))))
               ((eq (first y) (quote times))
                (combine (quote plus)
                         (maplist
                          (rest y)
                          (lambda (a) (combine
                                  (quote times)
                                  (maplist
                                   (rest y)
                                   (lambda (w) (cond
                                            ((not (eq a w)) (first w))
                                            (t (diff (first w) x))
                                            )))))))))))</b>
DIFF
AIM-8&gt; <b>(diff (quote (plus (times a x) b)) (quote x))</b>
(PLUS (PLUS (TIMES ZERO X) (TIMES A ONE)) ZERO)
AIM-8&gt; <b>(diff (quote (plus (times a x x) (times b x) c)) (quote x))</b>
(PLUS (PLUS (TIMES ZERO X X) (TIMES A ONE X) (TIMES A X ONE))
 (PLUS (TIMES ZERO X) (TIMES B ONE)) ZERO)

;; Beware, AIM-8 is defined with substitution evaluation.
;; Therefore, for each occurence of a variable, the whole expression
;; bound to this variable is evaluated again.  This gives surprizing
;; results for procedures with side-effects like PRINT and READ.
;; Moreover, this has the effect of giving exponential complexities very easily.

AIM-8&gt; <b>((lambda (x) (combine x (combine x nil))) (print (quote a)))</b>

A
A (A A)
AIM-8&gt; <b>(quit)</b>
GOOD BYE
NIL
[3]&gt; <b>(quit)</b>
Bye.
%

  </pre>

</div>
ViewGit