Fundamentals of Computer Science I: Media Computing (CS151.01 2008S)
[Skip to Body]
Primary:
[Front Door]
[Syllabus]

[Academic Honesty]
[Instructions]
Current:
[Outline]
[EBoard]
[Reading]
[Lab]
[Assignment]
Groupings:
[Assignments]
[EBoards]
[Examples]
[Exams]
[Handouts]
[Labs]
[Outlines]
[Projects]
[Readings]
References:
[AZ]
[Primary]
[Scheme Report (R5RS)]
[Scheme Reference]
[DrScheme Manual]
Related Courses:
[CSC151.02 2008S (Davis)]
[CSC151 2007F (Rebelsky)]
[CSC151 2007S (Rebelsky)]
[CSCS151 2005S (Stone)]
Misc:
[SamR]
[DrFu]
[GIMP]
[DrScheme]
Back to Project Ideas. On to Binary Search.
This outline is also available in PDF.
Held: Monday, 21 April 2008
Summary:
We visit the topic of higherorder procedures, one of the most
important techniques in languages like Scheme. Higherorder procedures
are procedures, like map
, that take other procedures
as parameters, return other procedures as values, or both.
Related Pages:
Notes:
Overview:
map
.all?
.(define hyp (lambda (a b) (sqrt (+ (* a a) (* b b)))))
The following is variant of something John Stone says ...
allreal?
and allinteger?
add5toeach
and multiplyeachby5
(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))
map
is the standard example.
(define map (lamda (fun lst) (if (null? lst) null (cons (fun (car lst)) (map fun (cdr lst))))))
(define allnumbers? (lambda (lst) (or (null? lst) (and (pair? lst) (number? (car lst)) (allnumbers? (cdr lst)))))) (define allsymbols? (lambda (lst) (or (null? lst) (and (pair? lst) (symbol? (car lst)) (allsymbols? (cdr lst))))))
(define all (lambda (test? lst) (or (null? lst) (and (pair? lst) (test? (car lst)) (all test? (cdr lst))))))
Back to Project Ideas. On to Binary Search.
[Skip to Body]
Primary:
[Front Door]
[Syllabus]

[Academic Honesty]
[Instructions]
Current:
[Outline]
[EBoard]
[Reading]
[Lab]
[Assignment]
Groupings:
[Assignments]
[EBoards]
[Examples]
[Exams]
[Handouts]
[Labs]
[Outlines]
[Projects]
[Readings]
References:
[AZ]
[Primary]
[Scheme Report (R5RS)]
[Scheme Reference]
[DrScheme Manual]
Related Courses:
[CSC151.02 2008S (Davis)]
[CSC151 2007F (Rebelsky)]
[CSC151 2007S (Rebelsky)]
[CSCS151 2005S (Stone)]
Misc:
[SamR]
[DrFu]
[GIMP]
[DrScheme]
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 Sat Apr 19 21:28:51 2008.
The source to the document was last modified on Thu Jan 17 16:44:18 2008.
This document may be found at http://www.cs.grinnell.edu/~rebelsky/Courses/CS151/2008S/Outlines/outline.44.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.