lisp-intro - Last update November 6 2008 Introduction to...

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

View Full Document Right Arrow Icon

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

View Full Document Right Arrow Icon

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

View Full Document Right Arrow Icon

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

View Full Document Right Arrow Icon

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

View Full Document Right Arrow Icon

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

View Full Document Right Arrow Icon

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

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Last update: November 6, 2008 Introduction to Lisp Dana Nau Dana Nau 1 Outline ♦ This is a quick introduction to Lisp ♦ I assume you know enough about computer languages that you can pick up new ones quickly, so I’ll go pretty fast ♦ If I go too fast, please say so and I’ll slow down ♦ Reading assignment: Chapters 1–9 of ANSI Common Lisp Dana Nau 2 What does “LISP” stand for?? Dana Nau 3 What does “LISP” stand for?? A speech defect in which you can’t pronounce the letter ‘s’? Dana Nau 4 What does “LISP” stand for?? A speech defect in which you can’t pronounce the letter ‘s’? L ooney I diotic S tupid P rofessor? Dana Nau 5 What does “LISP” stand for?? A speech defect in which you can’t pronounce the letter ‘s’? L ooney I diotic S tupid P rofessor? L ong I ncomprehensible S tring of P arentheses? Dana Nau 6 What does “LISP” stand for?? A speech defect in which you can’t pronounce the letter ‘s’? L ooney I diotic S tupid P rofessor? L ong I ncomprehensible S tring of P arentheses? LIS t P rocessing? Dana Nau 7 What is LISP? ♦ Originated by John McCarthy in 1959 as an implementation of recursive function theory. ♦ Primary data structure is a linked list Syntactic representation: (element 1 element 2 ... element n ) ♦ Don’t need a “pointer” data type The list-manipulation functions work directly on lists ♦ Even Lisp programs are lists! Syntax for function calls: (function arg1 arg2 ... argn) Example: x = -3 , then (if (>= x 0) x (- x)) returns 3 I’ll write this as (if (>= x 0) x (- x)) = ⇒ 3 Dana Nau 8 Examples of LISP applications ♦ AutoCAD - commercial system for computer-aided design system ♦ Emacs Lisp - Emacs’s extension language ♦ Script-Fu plugins for GIMP (GNU Image Manipulation Program) ♦ Remote Agent software - deployed on NASA’s Deep Space 1 (1998) ♦ ITA Software’s airline fare shopping engine - used by Orbitz ♦ Yahoo! Store - e-commerce software (about 20,000 stores as of 2003) Dana Nau 9 LISP’s influence on other languages Paul Graham, The Roots of Lisp , May 2001: It seems to me that there have been two really clean, consistent models of programming so far: the C model and the Lisp model. These two seem points of high ground, with swampy lowlands between them. As computers have grown more powerful, the new languages being developed have been moving steadily toward the Lisp model. A popular recipe for new programming languages in the past 20 years has been to take the C model of computing and add to it, piecemeal, parts taken from the Lisp model, like runtime typing and garbage collection. Dana Nau 10 Examples Lisp was the first language to have: ♦ Conditionals - if-then-else constructs ♦ A function type - functions are first-class objects ♦ Recursion ♦ Typed values rather than typed variables ♦ Garbage collection ♦ Commands = functional expressions that can return values ♦ A symbol type ♦ Built-in extensibility ♦ The whole language always available – programs can construct...
View Full Document

{[ snackBarMessage ]}

Page1 / 61

lisp-intro - Last update November 6 2008 Introduction to...

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

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