Here is what is what I did on the computer on 1998 April 6. In the lectures the answers appeared in the Xemacs minibuffer, but in this edited version, they appear after the Lisp expressions being evaluated. My plan is to write all lectures into the computer and make them available through the class web page. The web pages for the lectures will have URLs like this one but with the appropriate date. There was some blackboard discussion in the morning about list structure. I need an Xemacs function that will make box diagrams out of S-expressions. (defun alt (u) (if (or (null u) (null (cdr u))) u (cons (car u) (alt (cddr u))))) ; =>alt (alt '( a b c d e f)) ; =>(a c e) (alt nil) ; =>nil (alt '(a)) ; =>(a) (if t aa 'b) ; symbols value was void aa (car '((a c) b)) ; =>(a c) (cdddr '((a c) b)) ; =>nil - I said this should have been an error, because I think (car nil) and (cdr nil) should be undefined. (nth 3 '(a b c d)) ; =>d (nthcdr 3 '(a b c d)) ; =>(d) (append '(a b) '(d e f)) ; =>(a b d e f) (defun append1 (u v) (if (null u) v (cons (car u) (append1 (cdr u) v)))) ; =>append1 (cons '(a b) '(c)) ; =>((a b) c) (cons 'a 'b) ; =>(a . b) (append1 '(a c) 'b) ; =>(a c . b) '(a . (b .c)) ; =>(a b . c) (+ x y (* u v)) ; represents x + y + uv Next time we will write program to differentiate such expressions.