CS200: Computer Science, Spring 2002
|
Notes: Wednesday 6 February 2002
Schedule
- Lab Hours for PS3: Thursday (7 Feb) 6:30-800, Sunday (10 Feb) 4:00-5:30, Monday (11 Feb) 7:30-9:00
- 13 February: Problem Set 3
- Before 18 March: GEB all of Part I
Null/Nill Confusion In SICP, they use nil. In MzScheme (DrScheme's language), they use null. The Revised5 Report on the Algorithmic Language Scheme mentions nil but uses the empty list (denoted by '()) instead. As the footnote on page 101 explains, the exact meaning and name for the empty list is cause for lots of dispute and confusion. We will use null in class to be consistent with MzScheme.
Notes insertl.ss - code examples from this lectureHow can we define insertl?
(define (doubleall lst) (insertlg (lambda (a b) (cons (* 2 a) b)) lst null))How could we define insertlg?
def f ≡ isposint → iszero → g1 ; g2 o [f o dec, g3] ; error
-›› def f ≡ isposint → (/l:(g2 o [s1, g3 o s2])) o al o [g1 o ~0, intsto] ; error
FL Rewrite Rule (/l is insertl). (Shown for amusement purposes only.)
University of Virginia Department of Computer Science CS 200: Computer Science |
David Evans evans@virginia.edu Using these Materials |