Functional Problem Solving (CSC 151 2015S) : EBoards

CSC151.01 2015S, Class 32: Naming Local Procedures


Overview

Preliminaries

Admin

Upcoming Work

Extra Credit Opportunities

Academic

Peer Support (Morning Section)

Miscellaneous

Notes on Exam 2

Questions

Lab

Given that the computation of brightness is 0.3*red + 0.59*green + 0.11*blue, why is red the brightest color?

What should our solution to problem 2 look like?

(define irgb-brightest
  (letrec ([kernel (lambda (brightest-so-far remaining)
                     ...)])
    (lambda (colors)
      (cond
        [(null? colors)
         (error "irgb-brightness requires a non-empty list")]
        [(not (list? colors))
         (error "irgb-brightest expects a list, received" colors)]
        ...
        [else
         (kernel (car colors) (cdr colors))]))))

How do we check whether every element of a list is an irgb color?

Refer back to quiz 8.

Refer back to recursion with Booleans.

Debrief