Held: Monday, 17 February 2003
Summary: Today we investigate recursion over lists with a number of experiments.
to dolist (after preparing tomorrow's classes and grading 153).
hardest assignment in Sam's 151, is it worth assigning? (Yes, I'll ask you again nearer the end of the semester.)
patternone uses to design certain kinds of procedures.
(define proc (lambda (val) (if (base-case-test) (base-case val) (combine (partof val) (proc (update val))))))
(define proc (lambda (lst) (if (null? lst) null-case (combine (onestep (car val)) (proc (cdr val))))))
if. For example, here's one implementation of member that works on the principle that
valis a member of
lstif the list is not empty and
valis the first element of
valis a member of the remainder of
(define member? (lambda (val lst) (and (not (null? lst)) (or (equal? val (car lst)) (member? val (cdr lst))))))
Thursday, 16 January 2003 [Samuel A. Rebelsky]
Sunday-Monday, 16-17 February 2003 [Samuel A. Rebelsky]
I usually create these pages
on the fly, which means that I rarely
proofread them and they may contain bad grammar and incorrect details.
It also means that I tend to update them regularly (see the history for
more details). Feel free to contact me with any suggestions for changes.
This document was generated by
Siteweaver on Tue May 6 09:29:47 2003.
The source to the document was last modified on Mon Feb 17 11:41:23 2003.
This document may be found at