Fundamentals of CS I (CS151 2001S) : Outlines
[Current]
[Discussions]
[Glance]
[Honesty]
[Instructions]
[Links]
[News]
[Search]
[Syllabus]
Primary
[Examples]
[Exams]
[Handouts]
[Homework]
[Labs]
[Outlines]
[Quizzes]
[Readings]
[Reference]
Sets
[Blackboard]
[Scheme Report]
[SamR's Schedule]
[Rebelsky/Fall 2000]
[Walker/Fall2000]
[Stone/Spring2000]
Links
Reading: Variable-Arity Procedures. Lab: Variable-Arity Procedures. Back to Tail Recursion, Continued. On to Multiple-Valued Procedures.
Held Thursday, April 12, 2001
Summary
Today we consider how and why to write procedures that can take different numbers of arguments in different situations.
Notes
(let ((outport (open-output-file "example"))) (display "Hello There" outport) (newline outport) (display "Okay, now I'm done" outport) (newline outport) (close-output-port outport))
cmember? directly,
rather than implementing it with a call to member.
cmember? suggests that it returns
only #t or #f.
Overview
+ takes 0 or more parameters.
display takes 1 or 2 parameters.
map takes 2 or more parameters.
(lambda params body)
params is not parenthesized.
params as a list.
(lambda (first . remaining)
body)
+ In your body, treating remaining as a list.
(lambda (first second . remaining)
body)
+ In your body, treating remaining as a list.
Back to Tail Recursion, Continued. On to Multiple-Valued Procedures.
[Current]
[Discussions]
[Glance]
[Honesty]
[Instructions]
[Links]
[News]
[Search]
[Syllabus]
Primary
[Examples]
[Exams]
[Handouts]
[Homework]
[Labs]
[Outlines]
[Quizzes]
[Readings]
[Reference]
Sets
[Blackboard]
[Scheme Report]
[SamR's Schedule]
[Rebelsky/Fall 2000]
[Walker/Fall2000]
[Stone/Spring2000]
Links
Disclaimer: I usually create these pages on the fly. This means that they are rarely proofread and may contain bad grammar and incorrect details. It also means that I may update them regularly (see the history for more details). Feel free to contact me with any suggestions for changes.
This page was generated by Siteweaver on Wed May 5 12:15:07 2004.
This page may be found at http://www.cs.grinnell.edu/~rebelsky/Courses/CS151/2001S/outline.39.html.
You may validate
this page's HTML.
The source was last modified Tue Jan 23 16:01:58 2001.