CS 227 lecture -*- Outline -*- * debugging in Chez Scheme ----------- >(define id (lambda (x) x)) > ;... > (inspect id) # : show code: (lambda (x) x) # : quit ----------- can abbreviate show to "s" and quit to "q" can also use "code" or "c" to look at the code to see more of the body of a larger procedures, use "code" and then "tail 2" ---------------- > (load "member.ss") > (inspect member?) # : show code: (lambda (item ls) (if (null? ls) #f ...)) # : code (lambda (item ls) (if (null? ls) #f ...)) : ? length(l) ........... display list length car ................. inspect car of pair cdr ................. inspect cdr of pair ref(r) .............. inspect [nth] car tail ................ inspect [nth] cdr show(s) ............. show [n] elements of list ?? .................. display more options (lambda (item ls) (if (null? ls) #f ...)) : tail 2 ((if (null? ls) #f ((lambda (...) (...)) (equal? (...) item)))) : quit > ---------------- note that this code is code that is NOT exactly the same as what you typed, it has some things expanded, no comments, and is not formatted the way you formatted it the ... printed by the inspector means that there is more to see, but you have to use car, cdr, ref, or tail to see more.