;;;; 1.4 ;;;; ;Adam Nelson ;Chet Tobrey (defun is (x) x) (egs :1.4 (eg 'p :of "What is p?" :out '(John Q Public)) (eg '(first p) :of "First element of the list p" :out 'John) (eg '(rest p) :of "The rest of the list after the first of the list" :out '(Q Public)) (eg '(second p) :of "The second element in the list p" :of 'Q) (eg '(third p) :of "The third element in the list p" :out 'Public) (eg '(fourth p) :of "The fourth element in the list p" :out NIL) (eg '(length p) :of "The length of p" :out 3) (eg '(setf x '((1st element) 2 (element 3) ((4)) 5)) :of "Setting x to ((1st element) 2 (element 3) ((4)) 5)" ;:out ((1st element) 2 (element 3) ((4)) 5)) ) (eg '(length x) :of "Length of x" :out 5) (eg '(first x) :of "The first element in the list x" :out '(1st element)) (eg '(second x) :of "The second element in the list x" :out 2) (eg '(third x) :of "The third element in the list x" :out '(element 3)) (eg '(fourth x) :of "The fourth element in the list x" :out '((4))) (eg '(first (fourth x)) :of "The first element of the fourth element of the list x" :out '(4)) (eg '(first (first (fourth x))) :of "The first element of the first element of the fourth element of the list x" :out 4) (eg '(fifth x) :of "The fifth element of the list x" :out 5) (eg '(first x) :of "The first element in the list x" :out '(1st element)) (eg '(second (first x)) :of "The second element of the first element of x" :out 'Element) (eg 'p :of "What is p?" :out '(John Q Public)) (eg '(cons 'Mr p) :of "Constructing the list p with Mr" :out '(Mr John Q Public)) (eg '(cons (first p) (rest p)) :of "Constructing the first element in p with the rest of p" :out '(John Q Public)) (eg '(setf town (list 'Anytown 'Usa)) :of "Setting the variable town to a list of Anytown USA" :out '(Anytown Usa)) (eg '(append p '(of) town '(may have already won!)) :of "Appends the list p of anytown usa may have already won" :out '(John Q Public of Anytown USA may have already won!)) (eg 'p :of "What is p?" :out '(John Q Public)) (eg '(last p) :of "The last element in p" :out '(public)) (eg '(first (last p)) :of "The first element of the last element in p" :out 'Public))