| CSC 8310 Lisp Quiz Villanova University, Spring 2001 David Matuszek |
Section 1 Name ____________________________________________ |
Evaluate each of the following-- 3 points each
Please put your answer in the blank to the left of the expression
Assume: |
P = '((A) B C) |
_________________________ (QUOTE (A B))
_________________________ (QUOTE P)
_________________________ (CAR P)
_________________________ (CAR '((A B)))
_________________________ (CDR P)
_________________________ (CDR '((A B)))
_________________________ (CONS Q ( ))
_________________________ (CONS ( ) Q)
_________________________ (EQ ( ) NIL)
_________________________ (EQ Q Q)
_________________________ (ATOM '(( )))
_________________________ (LIST P)
_________________________ (LIST P Q)
_________________________ (LIST (QUOTE ((P Q))))
_________________________ (LIST (QUOTE A) (QUOTE (A)))
_________________________ (EQUAL P '((A) B C))
_________________________ (APPEND P Q)
_________________________ (APPEND P NIL)
_________________________ (NULL '(( )))
_________________________ (COND ((CDR Q) P) ((CAR Q) Q) (T NIL) )
21. (10 points) Given the following function definition:
(defun befog (a lat)
(cond
((null lat) t)
((eq a (car lat)) nil)
(t (befog a (cdr lat))) ) )
what is the result of the following function calls?
___________________________________ (befog 'a '(a s i a) )
___________________________________ (befog 'b '((a b) c (d e)) )
Short answer questions -- 5 points
each
Fill in the blanks.
Survey -- just for my own information
This does not count toward your grade.
Did you attempt the online Lisp quiz?
Did you successfully complete the online Lisp quiz?
If not, did you have problems with the program?
Do you think that the online quiz is, in general, a good idea?