104 lines
4.4 KiB
HTML
104 lines
4.4 KiB
HTML
|
<!DOCTYPE HTML PUBLIC "-//W3O//DTD W3 HTML 2.0//EN">
|
||
|
<!Originally converted to HTML using LaTeX2HTML 95 (Thu Jan 19 1995) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds >
|
||
|
<HEAD>
|
||
|
<TITLE> Background and Getting Started</TITLE>
|
||
|
</HEAD>
|
||
|
<BODY>
|
||
|
<meta name="description" value=" Background and Getting Started">
|
||
|
<meta name="keywords" value="lp">
|
||
|
<meta name="resource-type" value="document">
|
||
|
<meta name="distribution" value="global">
|
||
|
<P>
|
||
|
<BR> <HR>
|
||
|
<A HREF="node4.html"><IMG ALIGN=BOTTOM ALT="next" SRC="next_motif.gif"></A>
|
||
|
<A HREF="node2.html"><IMG ALIGN=BOTTOM ALT="up" SRC="up_motif.gif"></A>
|
||
|
<A HREF="node2.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="previous_motif.gif"></A> <BR>
|
||
|
<A HREF="lp.html"><B>Contents</B></A>
|
||
|
<B> Next:</B>
|
||
|
<A HREF="node4.html"> Basic Data Types</A>
|
||
|
<B>Up:</B>
|
||
|
<A HREF="node2.html"> LISt Processing</A>
|
||
|
<B> Previous:</B>
|
||
|
<A HREF="node2.html"> LISt Processing</A>
|
||
|
<BR> <HR> <P>
|
||
|
<H1> Background and Getting Started</H1>
|
||
|
<P>
|
||
|
<em>LISP</em> is an acronym for <b> LIS</b>t <b> P</b>rocessor. It was developed by John
|
||
|
McCarthy in the late 1950s, and his account of its history can be found at
|
||
|
<a href="http://www-formal.stanford.edu/jmc/history/lisp/lisp.html" target="mccarthy">http://www-formal.stanford.edu/jmc/history/lisp/lisp.html</a>. Lisp found many adherents in the artificial
|
||
|
intelligence community, and it is one of the oldest computer
|
||
|
languages still in widespread use.
|
||
|
<P>
|
||
|
There are many variants (or dialects) of Lisp including Scheme, T,
|
||
|
etc. In the 1980s there was an attempt to standardize the language.
|
||
|
The result is Common Lisp (see Guy L. Steele, Jr., <em> Common Lisp: The
|
||
|
Language, 2nd Edition</em>, Digital Press, 1990). Common Lisp is now the
|
||
|
most popular dialect.
|
||
|
<P>
|
||
|
|
||
|
If you are familiar with another programming language, such as C,
|
||
|
Pascal, or Fortran, you will be familiar with the concept of a
|
||
|
compiler. A compiler is a program that takes a complete program
|
||
|
written in one of these languages and turns it into a set of binary
|
||
|
instructions that the computer can process. All major implemenations
|
||
|
of Lisp provide a compiler, but unlike most languages, Lisp is also
|
||
|
often used as an interpreted language. This means that you can start
|
||
|
an interpreter which can process and respond directly to programs
|
||
|
written in Lisp. Interacting with an interpreter makes easy
|
||
|
interactive prototyping and debugging of programs possible. Once
|
||
|
compiled, Lisp programs run just as fast and efficiently as
|
||
|
well-written code in other standardly-compiled languages.
|
||
|
|
||
|
<P>
|
||
|
When you start up a Lisp interpreter, a prompt will appear, something like this:
|
||
|
<P>
|
||
|
<BLOCKQUOTE>
|
||
|
<PRE>>
|
||
|
</PRE>
|
||
|
</BLOCKQUOTE>
|
||
|
The Lisp interpreter waits for you to enter a well-formed Lisp
|
||
|
expression. Once you have entered an expression, it immediately
|
||
|
evaluates the expression entered and returns a response. For
|
||
|
example:
|
||
|
<P>
|
||
|
<BLOCKQUOTE>
|
||
|
<PRE>> (+ 1 2 3 4)
|
||
|
10
|
||
|
>
|
||
|
</PRE>
|
||
|
</BLOCKQUOTE>
|
||
|
In this example, the user typed the Lisp expression (+ 1 2 3 4) and the interpreter responded with 10 and a new prompt.
|
||
|
<P>
|
||
|
The interpreter runs what is known as a <em> read-eval-print</em> loop. That
|
||
|
is, it <em> reads</em> what you type, <em> evaluates</em> it, and then <em> prints</em> the result, before providing another prompt.
|
||
|
<P>
|
||
|
In what follows, it will be assumed that you have a Lisp interpreter
|
||
|
running in front of you. Exactly how to start Lisp up will depend on
|
||
|
the computer system you are using. If you need to, check the instructions for your Lisp interpreter or ask a local person to find out
|
||
|
how to get started. You will also need to know how to get out of the
|
||
|
Lisp interpreter. This too varies, even between implementations of
|
||
|
Common Lisp, but (quit), (exit), and (bye) are some common alternatives.
|
||
|
<P>
|
||
|
Do not go any further until you know how to start up and exit
|
||
|
Lisp on your system.
|
||
|
<P>
|
||
|
<BR> <HR>
|
||
|
<A HREF="node4.html"><IMG ALIGN=BOTTOM ALT="next" SRC="next_motif.gif"></A>
|
||
|
<A HREF="node2.html"><IMG ALIGN=BOTTOM ALT="up" SRC="up_motif.gif"></A>
|
||
|
<A HREF="node2.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="previous_motif.gif"></A> <BR>
|
||
|
<A HREF="lp.html"><B>Contents</B></A>
|
||
|
<B> Next:</B>
|
||
|
<A HREF="node4.html"> Basic Data Types</A>
|
||
|
<B>Up:</B>
|
||
|
<A HREF="node2.html"> LISt Processing</A>
|
||
|
<B> Previous:</B>
|
||
|
<A HREF="node2.html"> LISt Processing</A>
|
||
|
<BR> <HR> <P>
|
||
|
<BR> <HR>
|
||
|
<P>
|
||
|
<ADDRESS>
|
||
|
<I>© Colin Allen & Maneesh Dhagat <BR>
|
||
|
March 2007 </I>
|
||
|
</ADDRESS>
|
||
|
</BODY>
|