[CSUSB] >> [CNS] >> [Comp Sci Dept] >> [R J Botting] >> [CSci620] >> lab14 [Source]
[Index] [Schedule] [Syllabi] [Text] [Labs] [Projects] [Resources] [Search] [Grading]
Notes: [01] [02] [03] [04] [05] [06] [07] [08] [09] [10] [11] [12] [13] [14] [15] [16]
Thu May 13 11:43:07 PDT 2004

# CS620 Lab 14 LISP101

## Goal

To start to learn the syntax and semantics of LISP.

## Deliverable

A set of notes on what you have learned about S-expressions and Functions. PLus a demo of one of the LISP functions defined in the text.

You can show me your notes on paper, in a computer file, or on the web.

## Process

1. Open a terminal window and follow the instructions in the LISP handout for starting XLISP running in the window.
2. Open the text at page 171 and input the LISP expressions. Do they work as predicted? Take notes of expressions and what happens. Especially note any typing mistakes. By taking note of our errors we can learn to avoid them.
• The three function definitions (defun ....) are expression as well.
• Input them carefully.
3. Repeat for pages 173-175.
• The last expression on page 175 fails.... Why?
• After executing a SETQ it will work:
` 			(SETQ X 70)`
` 			(COND ((> X 90) '(a)) (t '(b)))`
` 			(SETQ X 100)`
` 			(COND ((> X 90) '(a)) (t '(b)))`
• See Figure 7.8. Explain!
4. Create a file called fact.lsp that contains the defun on page 176. Be very very very careful about parentheses.
5. Starting with the (load "fact.lsp") command on page 177 test out the definition and expressions on pages 177 and 178.

. . . . . . . . . ( end of section CS620 Lab 14 LISP101) <<Contents | Index>>

# Glossary

1. BNF::="Backus-Naur Form", for syntax and grammar, developed by Backus and Naur.
2. EBNF::="Extended " BNF.
3. HTML::= "HyperText Markup Language", used on the WWW.
5. Java::="An " OO " Language from Sun".
6. LISP::= "LISt Processing Language".
7. LRM::="Language Reference Manual".
8. OO::="Object-Oriented".
9. Prolog::="Programming in Logic".
10. TBA::="To Be Announced".
11. UML::="Unified Modeling Language".
12. URL::=Universal_Resource_Locator,
13. Universal_Resource_Locator::syntax= protocol ":" location, where
Net
1. protocol::= "http" | "ftp" | "mailto" | ... ,
2. location::= O( "//" host) O(pathname).

(End of Net)
14. WWW::= See http://www.csci.csusb.edu/dick/cs620/, index to web site for this class.
15. XBNF::="eXtreme" BNF, developed by the teacher from EBNF, designed to ASCII input of syntax, semantics, and other formal specifications.