CSC151 2010S, Class 38: Trees Overview: * The "listp?" problem from yesterday. * Notes on assignment 7. * Important points of reading. * Q&A on reading. * Lab. Admin: * Reading for Wednesday: Project Ideas. * Most of you made it to the last problem on yesterday's lab. Success! * Reminder: EC for any one Rosenfield Symposium on Poverty event. * No, we have no idea what's happening with our server. Try eliminating the cache on your Web browser if it happens again. Write a procedure, (listp? val), that determines whether val is a list. * First question for ourselves: What is a list * Purpose: Something that collects values * Construction: Either: * A pair in which the car is any value and the cdr is a list * Null (define listp? (lambda (val) (or (null? val) (and (pair? val) (listp? (cdr val)))))) More verbose and less elegant ways of writing the same thing (define listp? (lambda (val) (if (null? val) #t (if (not (pair? val)) #f (listp? (cdr val)))))) Assignment 7 How do I use recursion, given that there are no lists? * We can recurse over things other than lists. How do I think about the problem?