Re: Reminder Re Work To Do
Dear CSCI-316 Students,
Lisp Assignment 3 is now available to you in the Assignments section on Brightspace.
Even though the submission deadline is October 21, you should aim to finish the assignment a day or two sooner in order to have more time to work on Lisp Assignment 4 and two related reading assignments (which will be provided to you before October 17).
Be sure to carefully read the instructions on the 1st and the 3rd pages of the assignment document, including notes 1-5 on the 1st page!
When writing your submissions to this and future Lisp assignments, follow the rules in the indentation-&-spacing-rules-for-Lisp-Assignments-2-3-4-5 document on Brightspace.
Important Notes on Submission
The assignment must be submitted on mars. Do NOT do this assignment on your own PC or Mac unless you are confident you will be able to copy the file containing your solutions to mars! You won’t be able to copy the file from an off-campus PC or Mac to mars unless you can connect to the QC VPN.
Reading Assignments
Reading assignments A, B, and C below relate to Assignment 3. You should be in a position to do all nine problems of Assignment 3 after you have attended our 9th class (on 10/8, next Wednesday) and finished reading assignments A and B.
You should finish reading assignments A and B BEFORE we meet for our 10th class on Tuesday of the week after next (10/14). Reading assignment C below can be done AFTER you have done Assignment 3 but should be done BEFORE you read the solutions to Assignment 3 that will be provided to you after the due date.
See you in class on Monday.
Reading Assignment A
- Read sec. 6.13 (“EQUALITY OF OBJECTS”) on pp. 195-98 of Touretzky.
- Read secs. 1.10 and 1.11 on pp. 18-21 of Touretzky.
- Read sec. 2.15 and the SUMMARY on pp. 66-68 of Touretzky.
- Read sec. 6.6.1 (“MEMBER”) on pp. 170-71 of Touretzky; also read the paragraphs about MEMBER at the bottom of p. 199 and the top of p. 200 in sec. 6.14.
- Read about TYPEP in sec. 12.2 (on pp. 366-67) of Touretzky. The type names in Fig. 12-1 in sec. 12.2 that you need to know are: SYMBOL, NUMBER, INTEGER, RATIO, RATIONAL, FLOAT, NULL, LIST, CONS. You also need to know the type names ATOM and REAL. (A value is REAL if it is an integer, a ratio, or a floating point number.)
Reading Assignment B
- Read about IF and COND in secs. 4.1-4.6 (on pp. 113-20) of Touretzky.
- Read about AND and OR in secs. 4.7-4.10 (on pp. 122-25) of Touretzky.
Reading Assignment C
Read the following pages from Sethi’s book; these pages are all in the Course Reader. (This reading does not have to be done until AFTER you’ve finished Lisp Assignment 3, but should be done BEFORE you read the solutions to Lisp Assignment 3 that will be provided to you after the due date.) Note that the page numbers below refer to the page numbers shown at the TOP of the relevant pages of the course reader (and NOT the numbers shown at the bottom of each page). For example, p. 386 is the 2nd page after the course reader’s Table of Contents.
-
(i) The subsection “How to Interact with a Scheme Interpreter” on pp. 386-8. Note: In Common Lisp, you can use SETF instead of Scheme’s DEFINE to give a value to a variable.
-
(ii) The subsections “How to Write an Expression” and “How to Define a Function” on pp. 388-9 (but note that, in Common Lisp, DEFUN is used instead of Scheme’s DEFINE to define a function, and an opening parenthesis is placed AFTER the name of the function that is being defined, rather than immediately before the function name as in Scheme).
-
(iii) The “Conditionals” subsection on p. 390.
-
(iv) The subsection “Quoting” on pp. 391-2 (but note that the
(define f *)example on p. 392 does not work in Common Lisp). -
(v) The subsections “List Elements” and “Operations on Lists” on pp. 392-6.
Comment on Scheme to Common Lisp
The Common Lisp analogs of #t, #f, null?, number?, symbol?, equal?, and the (else ...) clause of a COND would be T, NIL, NULL (with no “?”), NUMBERP, SYMBOLP, EQUAL, and (T ...).
T. Yung Kong, D.Phil.
Professor
Computer Science Department
Queens College, CUNY
Flushing, NY 11367, U.S.A.