Fundamentals of Computer Science I (CS151.02 2007S)
[Skip to Body]
Primary:
[Front Door]
[Syllabus]
[Glance]
[Search]

[Academic Honesty]
[Instructions]
Current:
[Outline]
[EBoard]
[Reading]
[Lab]
[Assignment]
Groupings:
[EBoards]
[Examples]
[Exams]
[Handouts]
[Homework]
[Labs]
[Outlines]
[Projects]
[Readings]
Reference:
[Scheme Report (R5RS)]
[Scheme Reference]
[DrScheme Manual]
Related Courses:
[CSC151 2006F (Rebelsky)]
[CSC151.01 2007S (Davis)]
[CSCS151 2005S (Stone)]
Back to Drawing with ScriptFu. On to Association Lists and Searching.
This outline is also available in PDF.
Held: Monday, April 16, 2007
Summary: Today we revisit some of the important behindthescenes issues that last week's readings covered.
Related Pages:
Overview:
(define hyp (lambda (a b) (sqrt (+ (* a a) (* b b)))))
allreal?
and allinteger?
add5toeach
and multiplyeachby5
(lambda (params) body)
(define redder (lambda (amt) (lambda (color) (rgb ...))))
compose
(define compose (lambda (f g) (lambda (x) (f (g x)))))
(compose sin sqrt)
(compose car reverse)
leftsection
(define leftsection (lambda (func left) (lambda (right) (func left right)))) (define ls leftsection)
(ls + 2)
(ls * 2)
(define rightsection (lambda (func right) (lambda (left) (func left right)))) (define rs rightsection)
(define smokes? (rs vectorref 3))
(define scalegrades (lambda (grades) (if (null? grades) null (cons (* 4/3 (car grades)) (scalegrades (cdr grades)))))) (define fixedgrades (scalegrades originalgrades))
(define extracredit (lambda (grades) (if (null? grades) null (cons (+ 7 (car grades)) (extracredit (cdr grades))))))
(define map (lamda (fun lst) (if (null? lst) null (cons (fun (car lst)) (map fun (cdr lst))))))
(define scalegrades (lambda (grades) (map (lambda (grade) (* 4/3 grade)) grades))) (define extracredit (lambda (grades) (map (lambda (grade) (+ 7 grade)) grades)))
ls
(define scalegrades (lambda (grades) (map (ls * 4/3) grades))) (define extracredit (lambda (grades) (map (ls + 7) grades)))
(define scalegrades (ls map (ls * 4/3)))
(define extracredit (ls map (ls + 2)))
(define listofnumbers? (lambda (lst) (or (null? lst) (and (pair? lst) (real? (car lst)) (listofnumbers? (cdr lst)))))) (define listofsymbols? (lambda (lst) (or (null? lst) (and (pair? lst) (symbol? (car lst)) (listofsymbols? (cdr lst))))))
(define listof? (lambda (test? lst) (or (null? lst) (and (pair? lst) (test? (car lst)) (listof? test? (cdr lst))))))
(define validform? (lambda (val) (and (pair? val) (string? (car val)) (integer? (cdr val))))) (define allvalid? (lambda (lst) (listof? validform? lst)))
(define allvalid? (ls listof? validform?))
(define allvalid? (ls listof? (lamda (val) (and (pair? val) (string? (car val)) (integer? (cdr val))))))
Back to Drawing with ScriptFu. On to Association Lists and Searching.
[Skip to Body]
Primary:
[Front Door]
[Syllabus]
[Glance]
[Search]

[Academic Honesty]
[Instructions]
Current:
[Outline]
[EBoard]
[Reading]
[Lab]
[Assignment]
Groupings:
[EBoards]
[Examples]
[Exams]
[Handouts]
[Homework]
[Labs]
[Outlines]
[Projects]
[Readings]
Reference:
[Scheme Report (R5RS)]
[Scheme Reference]
[DrScheme Manual]
Related Courses:
[CSC151 2006F (Rebelsky)]
[CSC151.01 2007S (Davis)]
[CSCS151 2005S (Stone)]
Disclaimer:
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 Thu Sep 13 20:54:52 2007.
The source to the document was last modified on Thu Jan 18 12:30:12 2007.
This document may be found at http://www.cs.grinnell.edu/~rebelsky/Courses/CS151/2007S/Outlines/outline.41.html
.
You may wish to validate this document's HTML ; ;
Samuel A. Rebelsky, rebelsky@grinnell.eduhttp://creativecommons.org/licenses/bync/2.5/
or send a letter to Creative Commons, 543 Howard Street, 5th Floor,
San Francisco, California, 94105, USA.