01a_lisp_2pp - COMP 472/6721 Artificial Intelligence Common...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
COMP 472/6721 Artificial Intelligence Common Lisp Introduction Some slides were adapted from Peter Christensen (http://www.pchristensen.com), Chris Bryant (http://www.comp.rgu.ac.uk/staff/chb/) and various other sources Department of Computer Science and Software Engineering Concordia University, Montreal Origins of Lisp 1958: John McCarthy (MIT) writes an algebraic list processing language for AI work McCarthy’s grad student wrote a Lisp interpreter Strongly tied to AI research during the 70s and 80s Fell from prominence during the AI winter LISP is an acronym LIS t P rocessing refers to the fundamental structure, the list, underlying most LISP programs and data
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
McCarthy’s Goals Create a language for symbolic rather than numeric computation return to this later in this lecture Implement a model of computation based on the theory of recursive functions return to this is subsequent lecture Provide a clear definition of the language’s syntax and semantics Demonstrate formally the completeness of this model Lisp in Comparison Perspective Some old ideas seem old Some old ideas seem new Example of elegant, minimalist language Not C, C++, Java: a chance to think differently Illustrate general themes in language design Simple syntax (+ 1 2 3) (+ (* 2 3) (* 4 5)) (f x y) Easy to parse Programs as data
Background image of page 2
The Family of Lisp languages Common Lisp: ANSI Standard written in the 80s caused languages to coalesce, then implementations to flourish Scheme: A conceptually cleaner variant with a smaller specification Proprietary: LispWorks, Allegro Common Lisp You will use LispWorks in the labs Open Source: SBCL, CLisp, and others Others: compile to C, run on JVM, etc Innovations in the Design of Lisp Expression-oriented function expressions conditional expressions recursive functions Abstract view of memory Cells instead of array of numbered locations Automatic garbage collection Programs as data Higher-order functions
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Lisp is mostly Functional Functional is the most natural to write Can make sequential blocks, either explicitly or in constructs Can make and change values if needed Can build and incorporate new paradigms as necessary For instance, CLOS ( C ommon L isp O bject S ystem) Lisp is not strongly typed, more dynamically typed Variables are not typed but values are Lisp Has Lots of Parentheses… Used to group expressions Makes syntax simple and consistent Most forms are (function args*) Lisp expressions can be code or data Easy conversion between code and data Program code can be constructed at runtime Functions are first-order citizen of Lisp Functions can be arguments of other functions Executed dynamically
Background image of page 4
But the Parentheses Aren’t a Big Deal " Parentheses? What parentheses? I haven't noticed any parentheses since my first month of Lisp programming. I like to ask people who complain about parentheses in Lisp if they are bothered by all the spaces between words in a newspaper " - Ken Tilton Built-in editors indent automatically Reformatting integrated using a standard layout
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/01/2010 for the course ELEC 6111 taught by Professor Brown during the Spring '10 term at E. Illinois.

Page1 / 23

01a_lisp_2pp - COMP 472/6721 Artificial Intelligence Common...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online